Subform/Form Referencing

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!
 
S

Stuart McCall

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.
 
N

NEWER USER

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!


.
 
N

NEWER USER

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.


.
 

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