View Full Version : When does a combo box update the record source assigned to it?


JimMiller
01-31-2002, 08:10 AM
When does a combo box update the record source assigned to it? Does it wait until the form is closed or does it update after the new value is selected? Also what event corresponds to the updating of the record source associated with a combo box?

Any insites or information will be extremly helpful.

David R
01-31-2002, 08:50 AM
I just discovered (with the help of another topic here) a very cool help file yesterday: 'Find out when events occur'. There is a section on 'Order of Events for Controls on Forms', and a subheading about 'Changing and updating data in a control'. This should answer all your questions.

Note, this is in Acc2K, don't know about earlier versions.

HTH,
David R

[This message has been edited by David R (edited 01-31-2002).]

JimMiller
01-31-2002, 09:37 AM
Thanks for your post!

Do you know when controls are unavaliable/out of scope for queries and calculations?

David R
01-31-2002, 11:34 AM
Sorry, that's out of my scope. http://www.access-programmers.co.uk/ubb/biggrin.gif

David R

Pat Hartman
02-01-2002, 05:48 AM
The form needs to be open for it's controls to be referencable from other objects.

I don't understand your combobox question. A combobox may have a controlsource in which case it is bound to a field in the form's recordsource. This value is saved when the rest of the form is saved. The rowsource of a combobox specifies where it should get the list of data that it is supposed to display. When the combobox is bound, this list is automatically positioned to the value in the list that matches the value in the controlsource. If some other process updates the recordset from which the combo draws its data, the combo will not reflect the change until it is requiried. This happens automatically when you scroll the form to a new record. You can force it manually by using the Requery method -

Me.cmbYourCombo.Requery