Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Combo Box Help

0 views
Skip to first unread message

wesley...@gmail.com

unread,
Aug 13, 2006, 12:01:27 PM8/13/06
to
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.

pietl...@hotmail.com

unread,
Aug 13, 2006, 3:49:33 PM8/13/06
to
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.

John Vinson

unread,
Aug 13, 2006, 6:44:50 PM8/13/06
to
On 13 Aug 2006 09:01:27 -0700, "wesley...@gmail.com"
<wesley...@gmail.com> wrote:

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

wesley...@gmail.com

unread,
Aug 13, 2006, 7:05:48 PM8/13/06
to
Not sure how to do this? Any advice?

Thanks.

John Vinson

unread,
Aug 13, 2006, 9:12:13 PM8/13/06
to
On 13 Aug 2006 16:05:48 -0700, "wesley...@gmail.com"
<wesley...@gmail.com> wrote:

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

0 new messages