Hi
I'm trying to execute the following code:
sSQL = "insert into lkpChanges
(SiteRef,ProjectName,InvestmentType,FieldChanged,PreviousDate,NewDate,ChangeDate,CurrentRelaunch)
" & _
"values (" & sRef & ", """ & pName & """,""" & iType &
""",""" & fChange & """," & IIf(IsNull(pDate), Null, pDate) & "," &
IIf(IsNull(txtFSOS), Null, txtFSOS) & "," & Date & "," &
IIf(IsNull(txtFRelaunch), Null, txtFRelaunch) & ");"
DoCmd.RunSQL sSQL
which evaluates to:
insert into lkpChanges
(SiteRef,ProjectName,InvestmentType,FieldChanged,PreviousDate,NewDate,ChangeDate,CurrentRelaunch)
values (572, "Accrington","New","SOS",,02/01/2008,30/05/2008,);
However, i get the message "Syntax error in Insert Into statement"
I presume this is due to the null dates. Is there anyway around this?
Thanks
Paul


|