Append Macro error VBA

jrsl

Registered User.
Local time
Tomorrow, 07:49
Joined
Mar 25, 2009
Messages
26
Hi im new to Access and VB.

Im having trouble with appending a table to another access database table.
With my code im trying to make it only update new records.

Here is what i have:

Sub AppendMacro()
With DoCmd
.SetWarnings False
.RunSQL "INSERT INTO Customers1 ( [CNTR], [AccountNumber], [Title], [FirstName], [LastName], [Address1], [City], [PostCode], [State], [HomePhone], [WorkPhone], [MobilePhone], [Fax], , [CreationDate] ) IN 'C:\Users\Justin\Documents\test.mdb' FROM Customers WHERE Customers.APPENDED = No"
.RunSQL "SELECT Customers.CNTR, Customers.AccountNumber, Customers.Title, Customers.FirstName, Customers.LastName, Customers.Address1, Customers.City, Customers.PostCode, Customers.State, Customers.HomePhone, Customers.WorkPhone, Customers.MobilePhone, Customers.Fax, Customers.EMail, Customers.CreationDate"
.RunSQL "UPDATE Customers SET Customers.APPENDED = Yes;"
.SetWarnings True
End With
End Sub


This code gives me "Runtime error 3134"

Any ideas?

Regards,
Justin
 

Users who are viewing this thread

Back
Top Bottom