Communicating between forms

R

rsfishel

I am REALLY having trouble with this. I have a small pop-up form with
a combo box. Within this combo box are many part numbers. There is a
"Go" button beside of the combo box. What I am trying to get to
happen is that when the user picks a part number from the combo box,
then presses the "Go" button, that another form opens displaying the
records for that part number. I really want to be able to use the
"Go" button instead of this happening autmatically when the user steps
off of the control. My pop up form combo box is called Combo11. The
"Go" button is Command3. The field on my second form is called
PARTNUM. So basically, choose a part number from the list, then open
the second form and match up the value in Combo11 with PARTNUM. I
have been working on this all day long, and would really appreciate
some help. Thank you :)
 
R

Rick Brandt

I am REALLY having trouble with this. I have a small pop-up form with
a combo box. Within this combo box are many part numbers. There is a
"Go" button beside of the combo box. What I am trying to get to
happen is that when the user picks a part number from the combo box,
then presses the "Go" button, that another form opens displaying the
records for that part number. I really want to be able to use the
"Go" button instead of this happening autmatically when the user steps
off of the control. My pop up form combo box is called Combo11. The
"Go" button is Command3. The field on my second form is called
PARTNUM. So basically, choose a part number from the list, then open
the second form and match up the value in Combo11 with PARTNUM. I
have been working on this all day long, and would really appreciate
some help. Thank you :)

What code are you using behind your button? The command button wizard would
write that code for you.
 
H

Hunter57

I am REALLY having trouble with this. I have a small pop-up form with
a combo box. Within this combo box are many part numbers. There is a
"Go" button beside of the combo box. What I am trying to get to
happen is that when the user picks a part number from the combo box,
then presses the "Go" button, that another form opens displaying the
records for that part number. I really want to be able to use the
"Go" button instead of this happening autmatically when the user steps
off of the control. My pop up form combo box is called Combo11. The
"Go" button is Command3. The field on my second form is called
PARTNUM. So basically, choose a part number from the list, then open
the second form and match up the value in Combo11 with PARTNUM. I
have been working on this all day long, and would really appreciate
some help. Thank you :)

You might try something like this:

Private Sub Command3_Click()

Dim strCbo As Long
strCbo = Me!Combo11

DoCmd.OpenForm "YourFormName"
Forms!YourFormName![YourPARTNUMControlName].SetFocus
DoCmd.FindRecord (strCbo)

End Sub
 
R

rsfishel

What code are you using behind your button? The command button wizard would
write that code for you.

Rick, you were absolutely right. The command button wizard took care
of this for me EXCEPT I was hoping that the original form would close
after pulling up the new form with records on it. Any ideas? Thanks
for your help. I really appreciate it :)
 
R

Rick Brandt

Rick, you were absolutely right. The command button wizard took care
of this for me EXCEPT I was hoping that the original form would close
after pulling up the new form with records on it. Any ideas? Thanks
for your help. I really appreciate it :)

Just add one line to what the wizard generated...

DoCmd.Close acForm, Me.Name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top