I'm working on a program designed to draw numeric summary information out of a database. The user can select four criteria via dropdown combo boxes, and the information is displayed in a string grid (TStringGrid component). A second string grid component is used to hold the highest-level division of the four criteria (department); if that was left blank in the dropdown box, then all items of that type that match the other chosen criteria (if any) are displayed. Clicking on one of these items will then begin the numeric runthrough for that item. If only one item is present (specifically chosen from the dropdown originally, or the only thing that meets all criteria), then the program starts the numeric run automatically.
For some reason, when I've got selections in the dropdown boxes, any attempt to shift the focus away from the department string grid appears to empty the dropdown combo boxes; that is, the text in them vanishes, and the item index of the boxes appears to go to zero, as runs afterwards seem to be grabbing all information for the department in question. This does not happen every time, but does happen a large portion of the time. The only connection I can make with that is that it invariably happens after the form has been maximized to fill the screen.
I attempted to modify this behavior by adding in an 'onexit' event for the department grid component. Its purpose was to reset the item indices on the four dropdown combo boxes, using global variables to store the information. This does not appear to be working; the boxes still show a tendency to empty themselves.
Does anyone know of any reason why this might be occuring, and what I can do to remedy the situation?