Running SQL statements in VB

A

AL

Why does this SQL run command always produces a syntax error. The string was
copied from a select query in Access that worked on the desktop.

Dim SQL As String
SQL = "SELECT StudentTable.SeqNO FROM StudentTable WHERE
((StudentTable.SeqNO)=2)"
DoCmd.RunSQL SQL
 
S

Sylvain Lafontaine

Your sql string is not an update, insert or delete query; so it doesn't make
sense to use it with DoCmd.RunSQL.
 

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

Top