You can write VBA code to do that; the overall plan is to create a
string which is a SQL Insert query, then
DoCmd.RunSQL strSQLInsertQue ry
However,
A much easier approach (sually) is to use a statement (this version is
from Access 2000):
DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
This saves the current record. Just run the code before opening form2!
If you allow the user to open form2 only from a button on form1, then
this should work just fine, added to the button's click event.
Access will build that code if you turn on the Access Control Wizards,
create a button, and when the Wizard opens, specify Record Operations -
Save Record.
Bruce Pick
+++++++++++++++ +++++++++++++++ +++++++++++++++ +++++++++++++++ ++
To send mail, remove all < > and [ ] and the junk ~ between:
[brucepick1]
< a~t >
[comcast.net]
nic wrote:
Hi
I have two forms form1 and form2. I am trying to get all the data
entered in form1 to be updated to the table on an event. ie. when I
click the button to load form2, I need the data from form1 to exist in
the table for relationship reasons. form2 works fine if the records
displayed in form1 already exist in the table, ie form1 was closed
then re-opened or moving between records will also write the data to
the table. But if I have created a new record in form1 and then load
form2, any data is lost when the form is close as form1 data hasn't
been written to the table.
I would like for the data to be coded into the procedure that opens
form2. Also I am passing OpenArgs to form2.
Any suggestions.