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 TouchToneTommy 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 sync tabbed sub forms on a new record? 1

Status
Not open for further replies.

sap2

Technical User
Dec 20, 2007
12
US
Scenario:
Main form (1)- frm1 based on tbl01
User enters 3 parameters to filter by p1,p2,p3
Subforms (6)- fsub1-fsub6 (each with its own tab) also based on tbl01
ALL subforms are Linked to frm1 through 2 fields (p2,p3)

When the 3 parameters are chosen fsub1 will list the basic info associated with them. fsub2-fsub6 will list more specific info.

With the following additions:
fsub1 On current Event:
Forms![frm1]![fsub2].Requery

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![frm1]![fsub1].SetFocus
DoCmd.GoToRecord , , acNewRec
End If

This syncs the records across the tab (when tab is clicked)when p2/p3 has multiple records associated with it but if a new record is added fsub2 does not go to that new record until I toggle through the records in fsub1.

What I want to happen is when a new record is chosen in fsub1 THAT new record will show up for edit in fsub2 (when the tab is clicked) and fsub3 and fsub4... and so on.

I hope this was clear. I am not proficient with VBA so bare with me. Any help would be much appreciated. Thanks.
 
Have you tried a requery in the AfterInsert event?
 
Did I read this right? You have a main form and 6 subforms, all based on the same table?

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Remou:
I cannot remember if I tried on the AfterInsert event. I will do so.

Missinglinq:
You read correctly. All based on the same table. I am not an access guru, I am basically learning as I go. A lot of additions have happened on the fly. I guess its not the best, but what I have right now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top