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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving record to table

Status
Not open for further replies.

BabyPowder2u

Programmer
May 4, 2005
87
0
0
US
I have a main form with data relating to a request. It has a recordsource = tblRequest.
It accepts data for tblRequest, but also data for two other files (related by trknum).

I have several buttons (Process as Pending, Schedule Request, Cancel, Close Form).

When a user presses Process as Pending or Schedule Request, I verify the fields, and create the related tables. Problem is, I don't know how to update the tblRequest table. The form is for Adding Requests only there are no navigation buttons to cause it to go to the next record.

How can I save this record to the table?

Thanks,

T
 
By what you have here, I take it that you just want to insert data into the table, the way I would do it would be to open a new recordset in VBA, and insert the record this way.

You could use something like the following (if you are using ADO)

rsADO.Open CurrentProject.Connection
rsADO.AddNew
rsADO![Fieldname1] = Value
rsADO![Fieldname2] = Value
rsADO.Update
rsADO.Close

 
Hi Baby

use the following in the on click event of a 'save record' button


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
MsgBox "Record saved", vbInformation, "FORM TITLE"
DoCmd.GoToRecord , , acNewRec

Alternatively you could just use the
DoCmd.GoToRecord , , acNewRec
in any event to go to a new record.

Ian M (UK)


Program Error
Programmers do it one finger at a time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top