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.
>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]
Thanks.
>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]