T
Tony
Hi All,
I'm having trouble getting a listbox to requery. What I have is a listbox
bound to a query. Typically, when the user opens the form there are no
records to show in the listbox, so I hide it and display a text box on top
of it that says "No Records". After the user runs some code on the form
that puts records into tables that the query looks at, I'd like to requery
the listbox so that the records are shown. Using Me.lstBoxName.Requery
works when the listbox initially has records, but if it has no records to
display when the form is first opened, this does not work. The process I'm
using goes something like this:
1) Listbox is empty and hidden when form is opened
2) User runs code that populates tables from which the query the listbox is
bound to pulls data. If I run the query directly at this point, it shows
the correct records
3) The listbox is set to visible
4) The listbox is requeried
5) If the listbox had records when the form was opened, the requery works
and the correct records are shown. If there were no initial records for the
listbox to display, only a blank row is shown
Any help that can be offered is appreciated.
Thanks & Ciao,
Tony
I'm having trouble getting a listbox to requery. What I have is a listbox
bound to a query. Typically, when the user opens the form there are no
records to show in the listbox, so I hide it and display a text box on top
of it that says "No Records". After the user runs some code on the form
that puts records into tables that the query looks at, I'd like to requery
the listbox so that the records are shown. Using Me.lstBoxName.Requery
works when the listbox initially has records, but if it has no records to
display when the form is first opened, this does not work. The process I'm
using goes something like this:
1) Listbox is empty and hidden when form is opened
2) User runs code that populates tables from which the query the listbox is
bound to pulls data. If I run the query directly at this point, it shows
the correct records
3) The listbox is set to visible
4) The listbox is requeried
5) If the listbox had records when the form was opened, the requery works
and the correct records are shown. If there were no initial records for the
listbox to display, only a blank row is shown
Any help that can be offered is appreciated.
Thanks & Ciao,
Tony