Question Locked

opening form based on value in another

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

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

3 replies

by kevinnuut

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.

by informationfac

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

This discussion is closed to new replies.