saving and append button

  • Thread starter Thread starter chooriang
  • Start date Start date
C

chooriang

Hi all,
I just made a form and create a save button
by using wizard.I want each time the save button clicked,
it will automatically run an append query so that the data which just
recorded appended automatically to another table.Please Help
 
Just for data back up
Sorry not really understand with your expalnation but it seems doesn't work
I have a 'Save' button and the code are below

Private Sub CmdSimpan_Click()
On Error GoTo Err_CmdSimpan_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_CmdSimpan_Click:
Exit Sub

Err_CmdSimpan_Click:
MsgBox Err.Description
Resume Exit_CmdSimpan_Click



End Sub

What I need to add so that it will automatically execute my append query (
DC Fan Information Centre )
Thank's before


Klatuu said:
My first thought is why are you doing this? Duplicating data is not a
correct thing to do in a normalized relational database. I believe you need
to rethink your design; however, here is how you can accomplish this.

Create an append query that references the controls on your form. It will
look something like this:

INSERT INTO CISAttributeTable ( ACTIVITY, DESCRIPTION, ITM )
SELECT [forms]![frmAttributeTable]![txtActivity] AS Expr1,
[forms]![frmAttributetable]![txtdescription] AS Expr2,
[forms]![frmAttributeTable]![itm] AS Expr3;

If you choose to use the query builder, create a new query but don't select
a table.
Make it an append query. When it asks for a table name, give it the name of
the table you want to append the record to.
In the field row of the builder, enter the names of the controls on your
form where you will get the data.
Choose the corresponding field from the list in the Append To row.

Once you have the query complete, use the Click event of the button to
execute the query:

CurrentDb.Execute("MyQueryName"), dbFailOnError

chooriang said:
Hi all,
I just made a form and create a save button
by using wizard.I want each time the save button clicked,
it will automatically run an append query so that the data which just
recorded appended automatically to another table.Please Help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top