If Statement to open a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I write an "If" statement to open another form when a specific value
is chosen from a combo box?
 
In the AfterUpdate event of the combo box:

If Me.cboName = "Specific value" then
DoCmd.OpenForm "Form Name"
(Else)
End If

I guess that's what you're attempting to do?

M
 
How do I write an "If" statement to open another form when a specific value
is chosen from a combo box?

Do you mean the value is criteria to open the form to a specific
record?
Is the value a Text Value or a Number Value?
If it's a Number datatype:
DoCmd.OpenForm "FormName", , , "[SomeNumberField] = "& Me![ComboBox]

If it is a Text datatype:
DoCmd.OpenForm "FormName", , , "[SomeTextField] = '" & Me![ComboBox] &
"'"
 
Yes that is what I was looking to do. It works fine but now how do I keep the
original form open in max view? When the new form opens it shrinks the
original form a bit on the screen. I want the new form to just "pop up"
without changing the original forms size. Can this be done?
 
Set the second form's Popup property=True.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 

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

Similar Threads


Back
Top