Forum Discussion
List Box anomaly
Unfortunately, without SEEING the actual code, it's impossible to guess what might be happening.
To share the code, you can open the form in design view and select the VBA for the button's click event. Copy it all and paste it here. That way someone might be able to spot a line that could be causing this.
Thanks for the prompt reply. Here is the code, but it's really amazingly simple..
Private Sub Command6_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmContractAdd"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
- George_HepworthMar 23, 2021Silver Contributor
Also, what happens in that second form, "frmContractAdd"? Is it adding a new contract to the table which is also the row source for this list box, by any chance?
- George_HepworthMar 23, 2021Silver Contributor
- RichNewmanMar 23, 2021Copper ContributorAs soon as I click that button.
When I was developing this, I used a copy of the production data placed on my laptop and linked to the tables in that local copy, just to improve performance. When I do that, this odd requerying action does seem to happen now that I'm looking closer, but so quickly that nobody would notice unless they tried. Likewise, when everyone was working in the office last year, the response time was much better. Now that folks are working from home with slower response times (varies by user of course) the requerying is much more noticeable, and one person shared her desktop with me and I saw that underlying list box requery a few times, very slowly. The odd behavior does seem to be specific to the listbox on the first form where the button to open the second form lives. The second form is to add a record to the database, and when that is done, and I close that 2nd form, then in that case there is an explicit requery of the listbox to display the added or modified record in the listbox. But this is happening before we even get that far.- George_HepworthMar 23, 2021Silver Contributor
Thank you. That was going to be my suggestion, in fact. So you see this requery even without closing the second form and BEFORE using it to add a new contract?