Same Subform Different Form

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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?
 
???

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]

?
 
Back
Top