Update list box

  • Thread starter Thread starter KateB
  • Start date Start date
K

KateB

I have a form in which I can enter courses being held throughout the year.
However, I also wish to display a list of the courses to make it easy to
switch between them and see the list of attendees (a subform). However, if I
change any information, e.g. date or tutor, the list box doesn't reflect the
change unless I go out and back in. The data source for the list is a query
so I assume I need to get the query to re-run if I change any other fields.
How do I do this?

Many thanks
 
I have a form in which I can enter courses being held throughout the year.
However, I also wish to display a list of the courses to make it easy to
switch between them and see the list of attendees (a subform). However, if I
change any information, e.g. date or tutor, the list box doesn't reflect the
change unless I go out and back in. The data source for the list is a query
so I assume I need to get the query to re-run if I change any other fields.
How do I do this?

Many thanks

Requery the listbox in the AfterUpdate event of the form which changes the
data: either

Forms!NameOfForm!NameOfListbox.Requery

or, if the listbox is on the same form as you're using to update, just

Me!NameOfListbox.Requery

Choose the Code Builder in the AfterUpdate event and put the proper requery
command between the Sub and End Sub lines.
 
Back
Top