Subform/Form Referencing

  • Thread starter Thread starter NEWER USER
  • Start date Start date
N

NEWER USER

I have a Subform that resides on numerous Forms. I have a calculated field
on the Subform that references a field on the Form.

[Cost] - Forms.FormName.[Cost]

As I place the same Subform on other Forms, the reference is now incorrect
because the Form Name has changed. What coding would I use to replace
Forms.FormName so the subform will reference the Current Form and display
values correctly? Any help appreciated!
 
NEWER USER said:
I have a Subform that resides on numerous Forms. I have a calculated field
on the Subform that references a field on the Form.

[Cost] - Forms.FormName.[Cost]

As I place the same Subform on other Forms, the reference is now incorrect
because the Form Name has changed. What coding would I use to replace
Forms.FormName so the subform will reference the Current Form and display
values correctly? Any help appreciated!

Me.Parent.Form.ControlName

is what you need.
 
Thank you so much. Worked perfectly. Happy Holidays.

Al Campagna said:
Newer,
Try...
=[parent].[Form]![Cost]

Tested OK for me, with a subform field that got it's vale from City
on my main form.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

NEWER USER said:
I have a Subform that resides on numerous Forms. I have a calculated field
on the Subform that references a field on the Form.

[Cost] - Forms.FormName.[Cost]

As I place the same Subform on other Forms, the reference is now incorrect
because the Form Name has changed. What coding would I use to replace
Forms.FormName so the subform will reference the Current Form and display
values correctly? Any help appreciated!


.
 
I had to use use [Cst]-[Parent].[Form]![Cst] to get it to work. Thanks for
the help.

Stuart McCall said:
NEWER USER said:
I have a Subform that resides on numerous Forms. I have a calculated field
on the Subform that references a field on the Form.

[Cost] - Forms.FormName.[Cost]

As I place the same Subform on other Forms, the reference is now incorrect
because the Form Name has changed. What coding would I use to replace
Forms.FormName so the subform will reference the Current Form and display
values correctly? Any help appreciated!

Me.Parent.Form.ControlName

is what you need.


.
 
Back
Top