Updating combo box based on a query

whitty15

Registered User.
Local time
Today, 04:08
Joined
Sep 27, 2006
Messages
14
The problem that i am currently encountering is that i have a combo box based on a query (the possible values that can be selected are the results from the query), but however the results of the query may change when a different date is selected from the same form.

I have a booking system. When i click on a date from the calendar, a query uses this data as its criteria to display the available rooms. However, when a different date is selected, the query does not seem to refresh or re-run, meaning that the values in the combo box are now not correct.

If i go to the design view of the form, and then back to the database view, the values in the combo box are now correct (as though it has re-run the query). I have tried on the various techniques of on click requery, or on change requery but this does not seem to work.

Any ideas?
Help much appreciated
 
The problem that i am currently encountering is that i have a combo box based on a query (the possible values that can be selected are the results from the query), but however the results of the query may change when a different date is selected from the same form.

I have a booking system. When i click on a date from the calendar, a query uses this data as its criteria to display the available rooms. However, when a different date is selected, the query does not seem to refresh or re-run, meaning that the values in the combo box are now not correct.

If i go to the design view of the form, and then back to the database view, the values in the combo box are now correct (as though it has re-run the query). I have tried on the various techniques of on click requery, or on change requery but this does not seem to work.

Any ideas?
Help much appreciated

Normally an [Afterupdate Event] for the control that lists the available rooms.

"Me.requery" or "Me.refresh"

This should work as it will update the combobox upon update of the other control.

I use this in a form that accepts a new record, and on the last field being completed - updates the entire form (including the combobox that lists names from the main table).
 
Last edited:
Cheers
The Me.Refresh on After Update event worked, however it did not work when i put Me.Requery

The problem is solved however.
Many Thanks
 
Me.refresh will refresh the form. Me.requery makes no sense as it tries to requery the whole form. Me.MyControl.requery works for an individual control, though.
 
Me.refresh will refresh the form. Me.requery makes no sense as it tries to requery the whole form. Me.MyControl.requery works for an individual control, though.

That's what I meant to say - He could either refresh the entire form or requery the individual control. Thanks for the clarification.
 

Users who are viewing this thread

Back
Top Bottom