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

Reference main form

Status
Not open for further replies.

DrKeith

Programmer
Sep 3, 2004
5
US
Hi,

I am inserting a subform (frm_switch) into many main forms (frm_main1, frm_main2, etc). Is there a way to reference the main form from the subform without using the name of each form?

I tried using Screen.ActiveForm in the code of the subform , but this just refers to the subform.

Dim testid as string
testid = Screen.ActiveForm!primkey

This does not get me the primkey for the main form, but tries to get the primkey for the subform (which is unbound).

Any ideas on how to do this?

(One alternative I came up with is to make a table (tbl_switch) which is linked to the primkey of the tables used by the main form, but was trying to avoid this.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top