Hello, am having a terrible time with this INSERT INTO statement. I know that single quotes go around text, dates need hashes, numerics need nothing. I can see the values for each of these is correct in debug mode, but still get the syntax error. If anyone can see the problem, would be very much appreciated.
Code:
sqlRef2 = "INSERT INTO tblStudent ( RefID, LangID, StatusID, FName, MName, LName, Suffix, PID, InstutID, Address, address2, HousingNum, City, State, StateID, Zip, CountryID, Prisoner, Gender, DOB, EarliestOut, DIF, DistributionCenter ) VALUES ( " & rs1![RefID] & ", " & rs1![LangID] & ", " & rs1![StatusID] & ", '" & rs1![FName] & "', '" & rs1![MName] & "', '" & rs1![LName] & "', '" & rs1![Suffix] & "', '" & rs1![PID] & "', " & rs1![InstutID] & ", '" & rs1![Address] & "',) " & _
"('" & rs1![address2] & "', '" & rs1![HousingNum] & "', '" & rs1![City] & "', '" & rs1![State] & "', " & rs1![StateID] & ", '" & rs1![Zip] & "', " & rs1![CountryID] & ", " & rs1![Prisoner] & ", '" & rs1![Gender] & "', #" & rs1![DOB] & "#, #" & rs1![EarliestOut] & "#, #" & rs1![DIF] & "#, " & rs1![DistributionCenter] & ");"
Also, here are the fields for clarification:
RefID: Number; LangID: Number; StatusID: Number; FName: Text; MName: Text; LName: Text; Suffix: Text; PID: Text; InstutID: Number; Address: Text; address2: Text; HousingNum: Text; City: Text; State: Text; StateID: Number; Prisoner: Yes/No; Gender: Text; DOB: Date/Time; EarliestOut: Date/Time; DIF: Date/Time; DistributionCenter: Number;
Thanks so much for any time spent on this!
Code:
sqlRef2 = "INSERT INTO tblStudent ( RefID, LangID, StatusID, FName, MName, LName, Suffix, PID, InstutID, Address, address2, HousingNum, City, State, StateID, Zip, CountryID, Prisoner, Gender, DOB, EarliestOut, DIF, DistributionCenter ) VALUES ( " & rs1![RefID] & ", " & rs1![LangID] & ", " & rs1![StatusID] & ", '" & rs1![FName] & "', '" & rs1![MName] & "', '" & rs1![LName] & "', '" & rs1![Suffix] & "', '" & rs1![PID] & "', " & rs1![InstutID] & ", '" & rs1![Address] & "',) " & _
"('" & rs1![address2] & "', '" & rs1![HousingNum] & "', '" & rs1![City] & "', '" & rs1![State] & "', " & rs1![StateID] & ", '" & rs1![Zip] & "', " & rs1![CountryID] & ", " & rs1![Prisoner] & ", '" & rs1![Gender] & "', #" & rs1![DOB] & "#, #" & rs1![EarliestOut] & "#, #" & rs1![DIF] & "#, " & rs1![DistributionCenter] & ");"
Also, here are the fields for clarification:
RefID: Number; LangID: Number; StatusID: Number; FName: Text; MName: Text; LName: Text; Suffix: Text; PID: Text; InstutID: Number; Address: Text; address2: Text; HousingNum: Text; City: Text; State: Text; StateID: Number; Prisoner: Yes/No; Gender: Text; DOB: Date/Time; EarliestOut: Date/Time; DIF: Date/Time; DistributionCenter: Number;
Thanks so much for any time spent on this!