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

How do I make a revise form that creates a new record??

Status
Not open for further replies.

Mtlca401

Programmer
Mar 18, 2003
42
US
I have a view (continuous)form, and on that form I have a revise button. I have check boxes for each record(using them as record selectors). You can only revise a record if the check box is selected, and can only revise one at a time. Now what I need to do is some how select a record from the view form, and have it open the info for the record where the check box is selected, into the revise form. Then when everything is updated in the revise form hit Ok, and it creates a new record with the next revision number. I kinda have an idea but I'm still a little stuck.

The revise form is a single view form with 2 sub forms on it, just in case you need to know that.

Thanks
 
Create the following codes in the OnClick event of the “Revise” button

‘Dim enough Strings to hold the data for all fields. For example

Dim tempField1 as string
Dim tempField2 as string
Dim tempFieldN as string

'Store the data from the current record

tempField1 = Me.FieldName1
tempField2 = Me.FieldName2
tempFieldN = Me.FieldNameN

'Goto new record

DoCmd.GoToRecord , , acNewRec

'Paste the data to fields on new record.

Me.FieldName1 = tempField1 ‘(Increment to 1 for revision number field)
Me.FieldName2 = tempField2
Me.FieldNameN = tempFieldN

The above codes should create a new record for a current record you are looking at upon click the revise button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top