COmbobox value in one form populates in a cbo in another form (1 Viewer)

chrisjames25

Registered User.
Local time
Today, 17:15
Joined
Dec 1, 2014
Messages
401
Hi.

I have a button and combobox in one form.

I want to click the button and do following:

1. open form2
2. populate cbox in form 2 with selection of cbox in form 1
3. close form 1

ANy help greatly appreciated.

Cheers

Chris
 

static

Registered User.
Local time
Today, 17:15
Joined
Nov 2, 2015
Messages
823
In design view, select the button
On the property sheet select [event procedure] + click the ellipsis.
In the procedure paste.

docmd.openform "form2"
forms.form2!NameofYourCombo = NameofComboOnForm1
docmd.Close acform ,me.name

edit the stuff in bold
 

chrisjames25

Registered User.
Local time
Today, 17:15
Joined
Dec 1, 2014
Messages
401
Brilliant thanks Static. I should have mentioned that i want the input in the Form2 Combobox to then select the relevant record from a table based on the input.

Is that also possible?
 

chrisjames25

Registered User.
Local time
Today, 17:15
Joined
Dec 1, 2014
Messages
401
Sorry i should elaborate.

WHen im in form2 and manually change the combobox it does select the relevant record for me its just when i use your code it doesnt.
I used the control wizard to build the macro for scrolling through records based on combobox selection.
 

static

Registered User.
Local time
Today, 17:15
Joined
Nov 2, 2015
Messages
823
docmd.openform "form2"
forms.form2!NameofYourCombo = NameofComboOnForm1
forms.form2.Recordset.FindFirst "[Category_ID]=" & NameofComboOnForm1
docmd.Close acform ,me.name

edited based on other thread
 
Last edited:

Users who are viewing this thread

Top Bottom