Combo Box Help

  • Thread starter Thread starter wesley.allen
  • Start date Start date
W

wesley.allen

Hello,

I have a pop-up form with a combo box that is populated by a table with
a record for each month of the year. The combo box is a criteria is a
query.

I want to open the pop-up form and have the combo box keep the
selection that I made the last time it was open, so I do not have to
make a selection in this combo box every time I open the sub-form.

Any help would be greatly appreciated.

Thank you.
 
Create a variable in a module.
set the value of the variable in the onChange event of the combobox.
when you open the form, set the value to the value of the public
variable.
 
I want to open the pop-up form and have the combo box keep the
selection that I made the last time it was open, so I do not have to
make a selection in this combo box every time I open the sub-form.

Set the combo's DefaultValue property to the value of the combo box in
its AfterUpdate event.

John W. Vinson[MVP]
 
Not sure how to do this? Any advice?

Thanks.


John said:
Set the combo's DefaultValue property to the value of the combo box in
its AfterUpdate event.

John W. Vinson[MVP]
 
Not sure how to do this? Any advice?

Open the Form in design view; view its Properties; select the combo
box, and find the AfterUpdate event on the Events tab. Click the ...
icon and choose "Code Builder".

Here's some sample VBA code; adapt to your control name:

Private Sub MyCombo_AfterUpdate()
Me.MyCombo.DefaultValue = """" & Me.MyCombo & """"
End Sub

John W. Vinson[MVP]
 
Back
Top