getting data from a form to a table

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

I have a small form that's used as a dialog box. Originally I had several
unbound controls, a cancel button, and a print button on the form. When the
print button was clicked a report printed. The report used a query that
used the information entered on the dialog box. NOW... They want to keep a
record of what was entered on the dialog box. How do I take that
information and append it to a table?

Karen
 
If it's Access 2000 and above, you can try SQL statement, for example in
onClick event for your button:

Dim SaveMyData As String
SaveMyData = "INSERT INTO [TableName] VALUES([Field1] =
Forms!DialogForm!ControlName)"
DoCmd.RunSQL SaveMyData
 
Okay, How do I write the INSERT INTO part with multiple fields? I tried
just one and got a message that indicated that the 'Number of query values
and destination fields are not the same'. I guess that means I can't write
to just one field in the table, I have to write to all of them.


JasonS said:
If it's Access 2000 and above, you can try SQL statement, for example in
onClick event for your button:

Dim SaveMyData As String
SaveMyData = "INSERT INTO [TableName] VALUES([Field1] =
Forms!DialogForm!ControlName)"
DoCmd.RunSQL SaveMyData

Karen said:
I have a small form that's used as a dialog box. Originally I had several
unbound controls, a cancel button, and a print button on the form. When the
print button was clicked a report printed. The report used a query that
used the information entered on the dialog box. NOW... They want to
keep
a
record of what was entered on the dialog box. How do I take that
information and append it to a table?

Karen
 
Back
Top