PDA

View Full Version : Update ComboBox



MartinGM
08-01-2018, 08:41 AM
I have a very simple form based on a Query.

It has a ComboBox to select records and displays a few fields from the Query corresponding to the ComboBox selection.

At the bottom of the form is the built-in Record Selector. If I use this to scroll through the records, the fields update accordingly but the ComboBox does not.

This is problem because the value in the ComboBox is used for some other operations.

Is there a way to update the ComboBox when scrolling through the records, as above ?

Thanks

Martin

OBP
08-01-2018, 12:23 PM
In the Form's "On Current" Event Procedure enter the followingVBA Code

If Not Me.NewRecord Then Me.Combo_Name_goes_here = Me.field_name_goes_here

Where the field name is the field that your combo uses to find the required record.

MartinGM
08-01-2018, 12:46 PM
Perfect ! Thank you.