D
Duncs
I'm trying to write a piece of SQL code for to be executed within a
VBA module. My SQL code is as follows:
"UPDATE tblActionDetails SET StatusId=" & stsWorkable & " WHERE
StatusId=" & stsLocked & " AND " & _
"#" & Format(Now(), "dd/mm/yyyy") & "# >= #" & DateAdd("d", 7, Format
(DateLocked, "dd/mm/yyyy")) & "#;"
Values are:
StatusID is a field in the table tblActionDetails
stsWorkable is a public enumerated set to 1
stsLocked is a public enumerated set to 2
DateLocked is a field in the table tblActionDetails
What I want to do is set the field StatusID to 1, where it has been
set to 2 for 7 or more days since the date value in DateLocked.
When I compile the code, it gives me the error:
"Variable not defined" and highlights the entry "DateLocked". What am
I doing wrong?
TIA
Duncs
VBA module. My SQL code is as follows:
"UPDATE tblActionDetails SET StatusId=" & stsWorkable & " WHERE
StatusId=" & stsLocked & " AND " & _
"#" & Format(Now(), "dd/mm/yyyy") & "# >= #" & DateAdd("d", 7, Format
(DateLocked, "dd/mm/yyyy")) & "#;"
Values are:
StatusID is a field in the table tblActionDetails
stsWorkable is a public enumerated set to 1
stsLocked is a public enumerated set to 2
DateLocked is a field in the table tblActionDetails
What I want to do is set the field StatusID to 1, where it has been
set to 2 for 7 or more days since the date value in DateLocked.
When I compile the code, it gives me the error:
"Variable not defined" and highlights the entry "DateLocked". What am
I doing wrong?
TIA
Duncs