BrokenBiker
ManicMechanic
- Local time
- Yesterday, 22:39
- Joined
- Mar 22, 2006
- Messages
- 128
well...for those of you who've been following my recent problems, thanks for the help. Things are going well...but I'm back with another question.
I was able to get the append queries working in VBA w/ the destination db as a variable. The next step in my db is a series of DELETE queries.
I got the first one to work, but the rest of them get errors stating that there's a missing operator.
The Main Table Delete code works fine. I copied it and then changed it up for the Inspected Employee delete SQL. I copied the SQL from a working copy of a designed delete-query, but I get errors. I can't find any difference between the two sets of code.
This has left me dazed and confused.
I was able to get the append queries working in VBA w/ the destination db as a variable. The next step in my db is a series of DELETE queries.
I got the first one to work, but the rest of them get errors stating that there's a missing operator.
Code:
'--------------Main Table Delete--------------This one works---
Dim qryDel As String
qryDel = "DELETE [Main Table].[Report Number], [Main Table].Rating, [Main Table].Pass, [Main Table].Fail, [Main Table].[Non Rated], [Main Table].[Chief Insp Review], [Main Table].[Inspection Type], [Main Table].TEC, [Main Table].Date, [Main Table].Shift, [Main Table].Time, [Main Table].[Inspector Number], [Main Table].[Supervisor Rank], [Main Table].[Supervisor Name], [Main Table].Location, [Main Table].[Equipment Type], [Main Table].[Equipment SN], [Main Table].Workcenter, [Main Table].Description, [Main Table].[Main Assessee]" & _
"FROM [Main Table] " & _
"WHERE ((([Main Table].Date)<Now()))"
DoCmd.SetWarnings False
DoCmd.RunSQL qryDel
MsgBox "Old records from Main Table deleted.", vbExclamation, "System Notice"
'--------------Inspected Employees Delete--------------This one doesn't----
Dim qryDelInsp As String
qryDelInsp = "DELETE [Inspected Employee Table].ReportNum, [Inspected Employee Table].EmpNum, [Inspected Employee Table].Rating, [Inspected Employee Table].[Total Inspectees], [Inspected Employee Table].Workcenter, [Inspected Employee Table].Pass, [Inspected Employee Table].Fail, [Inspected Employee Table].[Non Rated], [Inspected Employee Table].date" & _
"FROM [Inspected Employee Table] " & _
"WHERE ((([Inspected Employee Table].Date)<Now()))"
DoCmd.SetWarnings False
DoCmd.RunSQL qryDelInsp
MsgBox "Old records from Inspected Employees deleted.", vbExclamation, "System Notice"
The Main Table Delete code works fine. I copied it and then changed it up for the Inspected Employee delete SQL. I copied the SQL from a working copy of a designed delete-query, but I get errors. I can't find any difference between the two sets of code.
This has left me dazed and confused.