Forum Discussion
RichNewman
Mar 23, 2021Copper Contributor
List Box anomaly
I have a multi-user Access application -- each user has a client piece locally, all looking at a single Access database with the table data on a company network. A form on that client application (l...
RichNewman
Mar 23, 2021Copper Contributor
The unintentional requery happens before the user even makes a decision to add a contract or just close the popup with no changes. They just have to click the button to open the popup. By the way, it's not just the "Add Record" button. On the first form, there's also a button to delete a record. The user selects a record to delete from the list box in question, then clicks the Delete button, I throw up a warning message to be sure they want to perform the delete, if they affirm, I delete the selected record, and then I explicitly requery the list box (no additional form has been opened). In this case, the moment I click "Delete", I see the list box requerying, and again, I didn't even open a new form.
George_Hepworth
Mar 23, 2021Silver Contributor
RichNewman hm. That suggests the problem is not in the called form, then, but in the calling form. It is requerying the list box based on some internal event. As soon as it loses focus to the message box or to the called popup, something forces that requery. What other event(s) are in that form? Anything that could be going on there?
Also, is this on a subform or in a main form? It occurs to me that subforms do exhibit that repeated requery behavior when loading. Is that possibly involved?
- RichNewmanMar 23, 2021Copper ContributorThere's no sub-form. The form that contains the listbox in question has only one event procedure that executes OnOpen. There's nothing for the OnGotFocus or OnLostFocus events, though I see where you were headed there.