M
Maver1ck666
Hi everyone,
I have put together an sql statement to be run in a module but I am getting
a run time 3075 (missing operator) message when I try to run it.
The code is:
DoCmd.RunSQL "INSERT INTO [Tbl 1 All Data Merged And Populated] ( [Fund
Name], [Account Type], [Account Number], [Account Name], MannerOfAddress, " _
& "Salutation, ClAddLine1, ClAddLine2, ClAddLine3, ClAddLine4,
ClAddLine5, ClAddLine6, ClPostCode ) " _
& "SELECT TblInportSIS.[Fund Name], TblInportSIS.[Legal Wrapper],
TblInportSIS.[Policy ID], " _
& "IIf(IsNull([Investor Title]),[Investor Name],[Investor Title] + SPACE
[Investor Name] + SPACE [Investor Surname]) AS [Account Name], " _
& "IIf(IsNull([Investor Title]),[Investor Name],[Investor Title] + SPACE
(Left$([Investor Name],1)) + SPACE [Investor Surname]) AS MannerOfAddress, " _
& "IIf(IsNull([Investor Title]), '" & Sirs & "',[Investor Title] + SPACE
[Investor Surname]) AS Salutation, " _
& "TblInportSIS.Address1, TblInportSIS.Address2, TblInportSIS.Address3,
TblInportSIS.City, TblInportSIS.County, TblInportSIS.Country,
TblInportSIS.[Post Code] " _
& "FROM TblInportSIS;"
Any ideas what I have missed please as I have been staring at it for a while
and cant figure it out for the life of me.
Cheers all!
I have put together an sql statement to be run in a module but I am getting
a run time 3075 (missing operator) message when I try to run it.
The code is:
DoCmd.RunSQL "INSERT INTO [Tbl 1 All Data Merged And Populated] ( [Fund
Name], [Account Type], [Account Number], [Account Name], MannerOfAddress, " _
& "Salutation, ClAddLine1, ClAddLine2, ClAddLine3, ClAddLine4,
ClAddLine5, ClAddLine6, ClPostCode ) " _
& "SELECT TblInportSIS.[Fund Name], TblInportSIS.[Legal Wrapper],
TblInportSIS.[Policy ID], " _
& "IIf(IsNull([Investor Title]),[Investor Name],[Investor Title] + SPACE
[Investor Name] + SPACE [Investor Surname]) AS [Account Name], " _
& "IIf(IsNull([Investor Title]),[Investor Name],[Investor Title] + SPACE
(Left$([Investor Name],1)) + SPACE [Investor Surname]) AS MannerOfAddress, " _
& "IIf(IsNull([Investor Title]), '" & Sirs & "',[Investor Title] + SPACE
[Investor Surname]) AS Salutation, " _
& "TblInportSIS.Address1, TblInportSIS.Address2, TblInportSIS.Address3,
TblInportSIS.City, TblInportSIS.County, TblInportSIS.Country,
TblInportSIS.[Post Code] " _
& "FROM TblInportSIS;"
Any ideas what I have missed please as I have been staring at it for a while
and cant figure it out for the life of me.
Cheers all!