sub form filter

G

Gary Dolliver

Hi all,
I have a form [MAIN], which has a subform [1] (child name is [1_sub]), which
then has 2 sub forms [a] (child is [a_sub]) and (child is [b_sub]). When
a record in subform [a] is selected, I am sending an email out, but notice
that I cannot set up WHERE criteria for a report attachment in the
DoCmd.SendObject line. So, I was working with the record source for the
report to see if I could filter from there, but how would I reference a field
in sub form [a]? Does it matter that it is 3 forms down? If I could be
shown some syntax, I would be very appreciative, thanks
-gary
 
K

Klatuu

From the main form:
Me!1_sub.Form!a_sub.Form!SomeControl or property

The logic behin this is 1_sub is a control on the main form. You reference
its SourceObject property with Form and then a reference to a_sub which is a
control on the form of 1_sub, then a control or property on the form object
of a_sub.
 
G

Gary Dolliver

Thank you so much, exactly what I needed!
-gary

Klatuu said:
From the main form:
Me!1_sub.Form!a_sub.Form!SomeControl or property

The logic behin this is 1_sub is a control on the main form. You reference
its SourceObject property with Form and then a reference to a_sub which is a
control on the form of 1_sub, then a control or property on the form object
of a_sub.
--
Dave Hargis, Microsoft Access MVP


Gary Dolliver said:
Hi all,
I have a form [MAIN], which has a subform [1] (child name is [1_sub]), which
then has 2 sub forms [a] (child is [a_sub]) and (child is [b_sub]). When
a record in subform [a] is selected, I am sending an email out, but notice
that I cannot set up WHERE criteria for a report attachment in the
DoCmd.SendObject line. So, I was working with the record source for the
report to see if I could filter from there, but how would I reference a field
in sub form [a]? Does it matter that it is 3 forms down? If I could be
shown some syntax, I would be very appreciative, thanks
-gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top