Hi
I'm trying to execute the following code:
sSQL = "insert into lkpChanges
(SiteRef,Projec tName,Investmen tType,FieldChan ged,PreviousDat e,NewDate,Chang eDate,CurrentRe launch)
" & _
"values (" & sRef & ", """ & pName & """,""" & iType &
""",""" & fChange & """," & IIf(IsNull(pDat e), Null, pDate) & "," &
IIf(IsNull(txtF SOS), Null, txtFSOS) & "," & Date & "," &
IIf(IsNull(txtF Relaunch), Null, txtFRelaunch) & ");"
DoCmd.RunSQL sSQL
which evaluates to:
insert into lkpChanges
(SiteRef,Projec tName,Investmen tType,FieldChan ged,PreviousDat e,NewDate,Chang eDate,CurrentRe launch)
values (572, "Accrington","N ew","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
I'm trying to execute the following code:
sSQL = "insert into lkpChanges
(SiteRef,Projec tName,Investmen tType,FieldChan ged,PreviousDat e,NewDate,Chang eDate,CurrentRe launch)
" & _
"values (" & sRef & ", """ & pName & """,""" & iType &
""",""" & fChange & """," & IIf(IsNull(pDat e), Null, pDate) & "," &
IIf(IsNull(txtF SOS), Null, txtFSOS) & "," & Date & "," &
IIf(IsNull(txtF Relaunch), Null, txtFRelaunch) & ");"
DoCmd.RunSQL sSQL
which evaluates to:
insert into lkpChanges
(SiteRef,Projec tName,Investmen tType,FieldChan ged,PreviousDat e,NewDate,Chang eDate,CurrentRe launch)
values (572, "Accrington","N ew","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
Comment