Syntax Error

  • Thread starter Thread starter Mommio2
  • Start date Start date
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
 
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
 

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

Back
Top