Open form with a sub forms and set focus to specific record in subform

Staalung

New member
Local time
Tomorrow, 03:58
Joined
Sep 11, 2011
Messages
3
I have a main form with two subforms, where I am listing a lot of ringbinders in the first subform and showing all the catalog pages in the second subform.:

Main form: "frm_0_product_catalog_ringbinders"
Unlinked Subform: "frm_0_product_catalog_ringbinders_subfA"
Linked Subform: "frm_0_product_catalog_ringbinders_subfB" Master: "LinkRingbinder" Child: "ringbinder_id"
The Linked subform is linked to the undlinked subform through a Text Box with the name "LinkRingbinder" with the control source "=[frm_0_product_catalog_ringbinders_subfA].[Form]![ringbinderid]" on the Main Form.

From another form where I store all my catalog pages I want to open the Main Form "frm_0_product_catalog_ringbinders", and focus on the corresponding detail line in the Unlinked Subform "frm_0_product_catalog_ringbinders_subfA".

Normally I would use this vba code for opening a single main form with a subform:

Dim strForm As String
Dim strWhere As String

strForm = "frm_0_product_catalog_ringbinders"
strWhere = "[ringbinderid] = " & Me![ringbinder_id]

DoCmd.OpenForm strForm, acNormal, , strWhere, acFormEdit, acWindowNormal

I would really apreasiate hel to make the vba code, I have used more than half a day already. :banghead:
 

Users who are viewing this thread

Back
Top Bottom