The code should go in the After Update event of the combo box (dropdown) and
I am suprised you did not get an error. The syntax is not correct. Try it
this way:
If Me.SomeCombo = "The value you want to run the form" Then
DoCmd.OpenForm "prc frm", , , , , , Reason_for_visit = [Procedure]
The part that is the problem I can't tell what to do to fix it. The correct
syntax is
"[RecordSetField] = '" & ValueToSearchFor & "'"
[RecordSetField] has to be a field in the record source of the form you are
opening.
ValueToSearchFor has to be a value that you would expect to find in
[RecordSetField] in at least one record in the form's record source.
In this case, I am guessing this is a text value. That is the reason for
the qoutes.
If the data type of [RecordSetField] is text, then ValueToSearchFor has to
be enclosed in either single or double qoutes.
Ramtin said:
Hi
On my first form I have a drop-down box and I want if user selects specific
value, access opens my second from, I tried following code but not working:
DoCmd.OpenForm "prc frm", , , , , , Reason_for_visit = [Procedure]
my second from field on first form specific
value