Web Development



opening form based on value in another

By hamid_harrar ·

I have a form (A) which contains a subform (B).
B is based on a query that get it's value from A (another type of Query by Form). I also have a button on A which when clicked would open Form (C) at the record that I selected in B
all the forms and subform all get their data from the same table Customer and the primary key is CUSTID
Does anyone know the code to put in the button to load the selected record from B into C.

Thanks in advance for your help

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Subform Solution

by KevinNuut In reply to opening form based on val ...

To open form C using information from subform B using a button in A, try the following:

openForm("C", acNormal, "", "ID_For_C=" & me![Subform_B].form![ID_For_B].value, acWindowNormal, "").

Where me is the current scope of A, Subform_B is the name of subform B in A, and ID_For_B is whatever variable you want to associate with form C.

Collapse -


by informationfac In reply to Subform Solution

Thank you Kevin - this sounds like what I need - was this written as a macro, event, or VBA?

Related Discussions

Related Forums