Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Listbox won't requery

Status
Not open for further replies.

burgerman

Technical User
Sep 21, 2002
31
0
0
US
I am using the following code to requery several listboxes on a form after an append query has been run
[Forms]![position select]![List60].Requery
[Forms]![position select]![List142].Requery
[Forms]![position select]![List187].Requery
[Forms]![position select]![List89].Requery
[Forms]![position select]![List140].Requery
[Forms]![position select]![List109].Requery
[Forms]![position select]![List144].Requery
[Forms]![position select]![List240].Requery
[Forms]![position select]![List59].Requery
[Forms]![position select]![List141].Requery
my problem is that the listbox will not refresh unless I close and reopen the the form any suggestions?
 
I have experienced the same thing with a subform at times. I have never found an explanation concerning this situation but maybe someone else here can give us that. But, the workaround that I have found works is to reset the RowSource for the ListBox. Then requery the listbox.
Me![ListBoxName].RowSource = ""
Me![ListBoxName].RowSource = "qryNamesSelect"
Me![ListBoxName].Requery

You may be able to leave off the first line of code but I always use it this way. Blank it out and then reset it and requery. This doesn't always happen but when it does I fix it this way.

Post back if you have any questions. Let's hope someone else here has an answer as to why this happens at times.


Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top