Error 3141 (SELECT Statement....)

D

Dymondjack

Hello and thanks in advance.

I have an SQL string that doesnt seem to be working for whatever reason.

The SQL (as checked in the immediate window):

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.Description, FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

The Error:
Error 3141 (The SELECT Statement includes a reserved word or argument name
that is misspelled or missing, or the puncuation is incorrect)

I've got this identical SQL String in two other places in my code that run
without problem. I've double checked all spellings, field, table names, ect.
Any ideas on what might be causing this alarm would be greatly appreciated.

Thanks,
Jack
 
D

Douglas J. Steele

Description is a reserved word. If you cannot (or will not) change the name,
at least put square brackets around it. As well, you've got an unnecessary
comma after it.

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.[Description] FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

For a good discussion on what names to avoid in Access, see what Allen
Browne has at http://www.allenbrowne.com/AppIssueBadWord.html
 
D

Dymondjack

Thanks Douglas. I relized the extra comment right after I posted this (and
smacked myself the for not seeing it sooner). Had not realized that
Description was reserved. I will keep that list handy...

Douglas J. Steele said:
Description is a reserved word. If you cannot (or will not) change the name,
at least put square brackets around it. As well, you've got an unnecessary
comma after it.

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.[Description] FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

For a good discussion on what names to avoid in Access, see what Allen
Browne has at http://www.allenbrowne.com/AppIssueBadWord.html

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dymondjack said:
Hello and thanks in advance.

I have an SQL string that doesnt seem to be working for whatever reason.

The SQL (as checked in the immediate window):

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.Description, FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

The Error:
Error 3141 (The SELECT Statement includes a reserved word or argument name
that is misspelled or missing, or the puncuation is incorrect)

I've got this identical SQL String in two other places in my code that run
without problem. I've double checked all spellings, field, table names,
ect.
Any ideas on what might be causing this alarm would be greatly
appreciated.

Thanks,
Jack
 

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