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

Linking Multiple Forms Using RecordId 1

Status
Not open for further replies.

EPT

Technical User
Aug 17, 2001
110
US
I have a database that will be used for data entering survey (8,500 surveys; over 300 fields) information which has multiple forms and tables. The problem is how do you move between forms while remaining on the same RecordId. The first form creates the RecordId through autonumber and as you go from form1 to form2 to form3, etc., you want the RecorId number carried to the new form as it opens. It seems this should be easy but it's not. I know you need to use VBA code to accompolish this and I get close but the solution eludes me. Does anyone have some code they could share and/or suggestions. TIA
 
You can use the Open Form command and it's criteria parameter.

DoCmd.OpenForm "FormNo2", , , "RecordID = " & Me!RecordID

If your RecordID is alpha num you will need to use tick marks (apostrophe) like so...

DoCmd.OpenForm "FormNo2", , , "IdNo = '" & Me!IDNO & "'"

B-) ljprodev@yahoo.com
ProDev, MS Access Applications
 
Lonnie
I tried your suggestion and it seems to work with the test data that is already in Table1 but if you want to enter a new record the autonumber value from Form1 doesn't carryover to Form2, it is blank when Form2 opens.
 
Hi!

In that first form, you must force Access to save the record before going on. You can use DoCmd.RunCommand acCmdSaveRecord. Once that record is there, your other forms will bring it up when opened.

hth
Jeff Bridgham
 
Thanks All,
It appears to work fine in my test database. Monday I'll try to put the whole thing together. Glad you Guys didn't take an early weekend.
Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top