If Statement to open a form

S

Secret Squirrel

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

Someone

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
 
F

fredg

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] &
"'"
 
S

Secret Squirrel

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?
 
G

Graham R Seach

Set the second form's Popup property=True.

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