Syntax Error

M

Mommio2

Hello,
Could anyone please tell me how to fix the syntax error in my code? I
have tried both of the following but neither works. THANKS!!!

DoCmd.OpenForm "Students", acNormal, "",
"[Forms]![Menu]![Search_Student]=[Students]![Student_ Last_ Name],[Student_
First_ Name]", acEdit, acNormal

DoCmd.OpenForm "Students", acNormal, "",
"[Forms]![Menu]![Search_Student]=[Students]![Student_ Last_
Name],[Students]![Student_ First_ Name]", acEdit, acNormal

Mommio
 
J

J. Goddard

Your WHERE clause isn't right. You have a comma after [Student_ Last_
Name]. What are you trying to do - match two values? In SQL, to do
this you need: "[FieldName1] = value1 AND [fieldname2] = value2"
where value1 and value2 may or may not be in quotes.

What does the data in [Forms]![Menu]![Search_Student] look like? I have
a suspicion that your difficulty may be more that just a syntax error.

John
 
Top