synchronize sub forms-part 2

S

SAP2

Trying to sync subform records.

Used code from my previous question on this subject, but records do not sync
until after the record is changed (on navigation bar). I have a main form
(frm1) and six sub forms (fsub1-fsub6).

In fsub1 On Current Event:
Forms![frm1]![fsub2].Requery

In fsub2 On Current Event:
If IsNull(Forms![frm1]![fsub1].Form!ID) = False Then
Me.RecordsetClone.FindFirst "[ID] = " & Forms![frm1]![fsub1].Form!ID
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
Forms![fsub1].SetFocus
DoCmd.GoToRecord , , acNewRec
End If

I changed the focus to fsub1 b/c there is not always an ID (for a new
record) and it kept opening fsub2.

These are all subforms with separate tabs for each one. So when info for
fsub1 has been filled out I want to be able to click on fsub2 and be on the
same record and so forth.

I am not very proficient with VBA. I have been playing around with using
the code in fsub1 in different events, but none have given me the right
result.

Thank you in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top