What is wrong with my syntax

Kharonne

Newbie
Local time
Yesterday, 22:40
Joined
Sep 17, 2010
Messages
15
Hey Guys,

I have included a insert to statement. I am having issues with two of the variables. UpdateYear and UpdateMonthIndex. These two are just number variables, but I cannot figure out how to get the sql statement to realize they are numbers. I have no issue with the string variables.

SQLstr = "INSERT INTO [ProjectUpdate] ([ProjectNumber],[UpdateMonthIndex], [UpdateYear], [UpdateDate], [UpdateBy], [MonthlyUpdate])" & _
" SELECT '" & Me.ProjectNumber & "' AS ProjectNumber, " & _
Me.UpdateMonthIndex & " AS UpdateMonth, " & _
Me.UpdateYear & " AS Year, #" & _
Me.UpdateDate & "# AS Date, '" & _
Me.UpdateBy & "' AS Who, '" & _
Me.MonthlyUpdate & "' AS Monthly;"
 
I think you may be having a problem with this line:

Me.UpdateDate & "# AS Date,

DATE is an Access Reserved Word. Use UpdateDate instead.
 
Thank You,

I should have known that. It was clearly stated in my access book.
 

Users who are viewing this thread

Back
Top Bottom