Saving Data

  • Thread starter Thread starter box2003
  • Start date Start date
B

box2003

Greetings,

I have a form which is based on 4 unbound and related tables, I will call
them tables A,B,C, and D. When I have completed the data entry on the form
and save, I am perplexed as to how I should be saving information to 4
different tables on the same save button. I have primary and foreign keys
appropriately assigned to each table as necessary for the relationships. As
in the past, with one table, I have simply opened a recordset and saved the
respective form data to the respective table making use of the respective
primary key. In this case, would I open 4 recordsets in some sequence, one
for each table, making the necessary save to the 4 tables and making use of
respective table primary and foreign keys. If there is another way I should
be doing this, please advise or direct me to an area on web so I can review.
I think I have heard it referred to as "spatter or splatter" saves.

Thank you.
 
What is an "unbound table"?

If your form is bound to more than one table, and the underlying recordsetis
updateable, you can simply press page-down after you enter your data. This
will take you to the next blank record and will save what you just typed.
 
Perhaps I should have check posting content, the form is not based on a
table, actually an "unbound form". When I save data to the tables the form
fields represent, I will open a respective table and recordset and make the
addition of data to that table using code, then close the recordset and
perform any updates to the form by refresh or requery or repaint.
 
Using VBA, manually code the database operations in the OnClick event for
that button. Surround your multi-table operations with a "BeginTrans" and
"CommitTrans" pair, thus assuring data integrity.

That's all there is to it.
 
Back
Top