Command btn used to append data?

S

Seddon Acaster

Using Access 2000. I want to click on a command button in a form and append
data from about 15 fields to a table. I then want a form to open and
automatically show the newly appended data.

My code so far is as follows:

Private Sub Command680_Click()
DoCmd.RunSQL "INSERT INTO [invoice](accountno, invoicename, invoicepc,
invoicetotal, invoicebalance) VALUES ('" & Me.account & "','" & Me.faname &
"','" & Me.lastname & "','" & Me.fundingainv & "','" & Me.age & "')"
DoCmd.OpenForm "invoiceform"
End Sub

This doesn't fully work as it opens only the first record in invoiceform.
Also when I add a field in the table that contains the values (faname,
lastname, fundingainv etc it does not show up in the code window when I say
add a new value in the VALUES part of the SQL statement).

Help!!
 
Top