I had a query which worked fine so I've tried to move it into a module but the IDE complains. It says something like "expected end of statement" and highights the bold bit below.
DoCmd.RunSQL "INSERT INTO Inv_StaffList ( Surname, Forename)" & _
"SELECT Mid([DEV_CONTACT],(InStr(1,[DEV_CONTACT]," ")+1),((Len([DEV_CONTACT]))-InStr(1,[DEV_CONTACT]," ")))," & _
"Left([DEV_CONTACT],(InStr(1,[DEV_CONTACT]," ")-1))," & _
"FROM Applications",-1
My guess is it is having a problem with a quote appearing within a quoted string. How do you get around that?
DoCmd.RunSQL "INSERT INTO Inv_StaffList ( Surname, Forename)" & _
"SELECT Mid([DEV_CONTACT],(InStr(1,[DEV_CONTACT]," ")+1),((Len([DEV_CONTACT]))-InStr(1,[DEV_CONTACT]," ")))," & _
"Left([DEV_CONTACT],(InStr(1,[DEV_CONTACT]," ")-1))," & _
"FROM Applications",-1
My guess is it is having a problem with a quote appearing within a quoted string. How do you get around that?