Forum Discussion
IanaMac
Oct 20, 2021Brass Contributor
Simple VBA Code or should be
I have a simple spreadsheet with 4 columns Column A has the unique field I am try to insert new records to a SQL Table it works fine except when i add the WHERE parameter inother words where Column...
- Oct 22, 2021
Sorry, I can't help you with that. You might ask in the Access community hub.
HansVogelaar
Oct 20, 2021MVP
Change
MoviesCmd.CommandText = _
SQLStr = "INSERT INTO Customer_Master (GPCustID, RMCCustID, ComID, " & _
"LegalName, Partner) Values (" & GPCustID & ", " & RMCCustID & _
", " & ComID & ", '" & LegalName & "', '" & Partner & "')" & _
" WHERE " & GPCustID & " Not In (SELECT GPCustID FROM Customer_Master)"
to
MoviesCmd.CommandText = _
"INSERT INTO Customer_Master (GPCustID, RMCCustID, ComID, " & _
"LegalName, Partner) Values (" & GPCustID & ", " & RMCCustID & _
", " & ComID & ", '" & LegalName & "', '" & Partner & "')" & _
" WHERE " & GPCustID & " Not In (SELECT GPCustID FROM Customer_Master)"
IanaMac
Oct 22, 2021Brass Contributor
Thanks sorry to though i now have error message...
Run time 450
Wrong number of Arguements or invalid Property assignment.
Any thoughts?
Run time 450
Wrong number of Arguements or invalid Property assignment.
Any thoughts?
- HansVogelaarOct 22, 2021MVP
Sorry, I can't help you with that. You might ask in the Access community hub.