You can use the VBA Docmd.RunSQL command. Basically it is the same as running an append query. To get the SQL for it you could put together an append query and copy the SQL. I put together an an example that I ran. I made a table called AppendingFromCode. It has three fields. Name1, Address1, Amount1. Below is the code that I used to append amounts to the table. I used input boxes to get the values. You can modify as needed.
Public Function Appending()
Dim strName As String
Dim strAddress As String
Dim dolAmount As Currency
What you want to do is clearer in your code if you use a recordset. If you're OK with Lonnie's SQL, well and good, but if not, I can send you some typical code which will create the recordset and add a new record.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.