Question Locked

Access append records from form

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a form that gets data from two linked tables and also user input.

I would like to create a command button and have the fields on the form be appended to a new table.

Can someone point in the the right direction of how to start?

2 replies

by prakashcrao

One quick and dirty method..

You can use the SQL Insert Into Table command and embed it into a visual basic procedure that occurs on the click event of the command button.. for example, using DAO 3.6
Dim SelSQL as String
SelSQL = "Insert into NewTable(Col1,Col2,Col3..) Values(Val1,Val2,Val3..)"
CurrentDB.Execute(SelSQL)

Of course you have to use the right prefixes and suffixes for the appropriate data types such as single quotes for string data and # for date fields.

You will also have to trap on null values in your form to construct the SQL.

This discussion is closed to new replies.