Criteria for opening a form based on a value in another form's subform

  • Thread starter Thread starter seaton via AccessMonster.com
  • Start date Start date
S

seaton via AccessMonster.com

Hello everyone,

Please pardon the noob question, but I've got a form with a subform and I
would like to be able to open another form with only the records that match
the primary key from the first form's subform, but I am unable to figure out
how to specify that value in the query. In other forms (where subforms are
not invovled), I can accomplish this with something like:

=[Forms]![Form_Name].[Desired_Value]

Is there something different I need to be doing when attempting to get a
similar value from a subform?

With many thanks in advance for any advice...
 
Subforms are not open in their own right, so you have to refer to them
through the main form.

To refer to Text0 on subform MySub of main form MyMain, use:
[Forms].[MyMain].[MySub].[Form].[Text0]

Explanation in:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html
 
Excellent! That worked perfectly.

Thank you very much, Allen, you made my day!

That's a very useful site you've got there, by the way.

Allen said:
Subforms are not open in their own right, so you have to refer to them
through the main form.

To refer to Text0 on subform MySub of main form MyMain, use:
[Forms].[MyMain].[MySub].[Form].[Text0]

Explanation in:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html
 
Back
Top