Hi everyone,
I am using the following code but - it isn't putting the values of the form fields in my table.
Can you help me with the correct syntax?
Many thanks!
Dim dbs As DAO.Database
Dim strSQL As String
Set dbs = OpenDatabase("v:\lab\sdawOrderID\sdaw.mdb")
DoCmd.RunSQL "INSERT INTO Customer(Name, BillAddressAddr1, BillAddressAddr2) VALUES('" & [Forms].[AddCustomer].[Name] & "','" & [Forms].[AddCustomer].[Address1] & "','" & [Forms].[AddCustomer].[Address2] & "');"
dbs.Execute strSQL, dbFailOnError
dbs.Close
I am using the following code but - it isn't putting the values of the form fields in my table.
Can you help me with the correct syntax?
Many thanks!
Dim dbs As DAO.Database
Dim strSQL As String
Set dbs = OpenDatabase("v:\lab\sdawOrderID\sdaw.mdb")
DoCmd.RunSQL "INSERT INTO Customer(Name, BillAddressAddr1, BillAddressAddr2) VALUES('" & [Forms].[AddCustomer].[Name] & "','" & [Forms].[AddCustomer].[Address1] & "','" & [Forms].[AddCustomer].[Address2] & "');"
dbs.Execute strSQL, dbFailOnError
dbs.Close