Same Subform Different Form

G

Guest

I have a subform that I want to use on several different forms which look at
data differently. Each main form has a field that is named the same on each
form. The subform needs to get the data from that field to perform a
calculation on records from a separate table. The following code works well
for the first form:
=[Forms]![Order1]![shipping]

My problem is that the name of the main form is different each time
(OrderList, OrderSelect, etc.) and this could require 5 or more copies of the
same subform. Is there a generic way to refer to the form that the subform is
attached to so that one subform can be used on all of these forms?
 
G

Guest

Wow! Didn't know I could do this... THe following code worked great!
= Forms![Parent].[Form]![shipping]
Thanks for your help!


Van T. Dinh said:
Not sure but have you tried:

= [Parent].[Form]![shipping]

?
--
HTH
Van T. Dinh
MVP (Access)




David said:
I have a subform that I want to use on several different forms which look at
data differently. Each main form has a field that is named the same on each
form. The subform needs to get the data from that field to perform a
calculation on records from a separate table. The following code works well
for the first form:
=[Forms]![Order1]![shipping]

My problem is that the name of the main form is different each time
(OrderList, OrderSelect, etc.) and this could require 5 or more copies of the
same subform. Is there a generic way to refer to the form that the subform is
attached to so that one subform can be used on all of these forms?
 
V

Van T. Dinh

???

That's different from what I suggested!

--
HTH
Van T. Dinh
MVP (Access)


David said:
Wow! Didn't know I could do this... THe following code worked great!
= Forms![Parent].[Form]![shipping]
Thanks for your help!


Van T. Dinh said:
Not sure but have you tried:

= [Parent].[Form]![shipping]

?
 

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