Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a command button that create a particular table

Status
Not open for further replies.

Lreader

Technical User
Jul 27, 2000
13
CA
I have a form to compile course evaluation. This form is base on a table called "activity"and on a subform called "questions".
I need a button command in this form which create a table with the actual record parameter.Ex: I just finished to fill the form and I want a button command to create a table with the record I filled.

This table is useful because I build a report based on this table. Actually, I used parameters in a query which create this table but I would be more fine to do this in one step when I am working in the form.

 
'create code behind your button like this:
'this creates a table called acctsbak from the accts table
'make sure you include:
Private sql_def as String

Private Sub cmd_mail_Click()

'backup accounts information
sql_def = "SELECT DISTINCTROW accts.* INTO acctsbak FROM accts"
DoCmd.SetWarnings (False) 'turn overwrite warnings off
DoCmd.RunSQL (sql_def)
DoCmd.SetWarnings (True)

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top