C
Cevin
Hi All,
In Access2003 I'm trying to create a table when the user clicks on a form
button.
The code is:
DoCmd.RunSQL ("SELECT tblGages.CustCN AS CN, " & _
"tblGages.CustSN AS SN, " & _
"tblGages.GageFullDesc AS Gage, " & _
"tblGages.byteLocationID, " & _
"tblTeams.Team AS Team, " & _
"tblGages.Workcenter AS Workcenter, " & _
"tblGages.CalDue AS Due " & _
"tblGages.Status AS Status " & _
"INTO tbltmpDue " & _
"FROM tblTeams " & _
"INNER JOIN [tblGages] ON tblTeams.byteLocationID =
tblGages.byteLocationID " & _
"WHERE (((tblGages.CalDue) < " & dateDateDue & ") " & _
"And ((tblGages.Status) = 1) OR (tblGages.Status)=17) " & _
"ORDER BY tblTeams.Team;")
If I remove the
OR (tblGages.Status)=17)
it creates the table just fine. When the OR status is added I get
Run-time error '3141':
The SELECT statement includes a reserved word or an argument name
that is misspelled or missing, or the punctuation is incorrect
All items are declared in the option area.
Any ideas what I'm doing wrong, or am I trying to do something AccessVB
won't do?
Thanx in advance for your help.
Cevin
In Access2003 I'm trying to create a table when the user clicks on a form
button.
The code is:
DoCmd.RunSQL ("SELECT tblGages.CustCN AS CN, " & _
"tblGages.CustSN AS SN, " & _
"tblGages.GageFullDesc AS Gage, " & _
"tblGages.byteLocationID, " & _
"tblTeams.Team AS Team, " & _
"tblGages.Workcenter AS Workcenter, " & _
"tblGages.CalDue AS Due " & _
"tblGages.Status AS Status " & _
"INTO tbltmpDue " & _
"FROM tblTeams " & _
"INNER JOIN [tblGages] ON tblTeams.byteLocationID =
tblGages.byteLocationID " & _
"WHERE (((tblGages.CalDue) < " & dateDateDue & ") " & _
"And ((tblGages.Status) = 1) OR (tblGages.Status)=17) " & _
"ORDER BY tblTeams.Team;")
If I remove the
OR (tblGages.Status)=17)
it creates the table just fine. When the OR status is added I get
Run-time error '3141':
The SELECT statement includes a reserved word or an argument name
that is misspelled or missing, or the punctuation is incorrect
All items are declared in the option area.
Any ideas what I'm doing wrong, or am I trying to do something AccessVB
won't do?
Thanx in advance for your help.
Cevin