I posted a question on Microsoft Discussion Group and received a reply below to help my question also below. Can anyone please help a inexperienced vba individual get thru these steps. I am not sure where to place the code or how with the write statements. Thank you very much in advance.
Carl
carljohnman1819@msn.com
Question:
I was given a large form our company employees use to handwrite information into for the county courts. He ask me to create it in MS Access so it would be easier to locate specific dates, names, and status, extc. I broke the form down into 7 smaller forms which looks ok and stores the information ok but I can not figure out how to make the records match up or force the next one to default to the same record the previous one was on. I placed next command buttons on each form but when you click it it takes you to the next form record 1 not the next form record “3” I was finished entering information
on in the previous form. Can anyone please help?
Reply:
If I understand you correctly, you need to pass the primary key field from one form to another, then force the second form to jump to that correct record.
You can pass the key field to the next form using the OpenArgs property,
e.g.DoCmd.OpenForm “next form”,acNormal,,,,, Me![key field]
In the OnLoad event of the next form,
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst “[key field] = ” & Me.OpenArgs
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
—
Hope this helps
Tony Oakley (MVP)