Referencing Sub-form field from the main form. ------H E L P

L

lalexander

I have a Form & Sub-Form

What is the proper syntax to reference a field in the sub-form or visa
versa.

I tried accessing the field from the subform below:

:: [Forms].[pagosdet subform3].[fieldname]

but this doesn't seems to work.

I need to put the value of a subform field into a variable and add that
variable

to a field in the main-form.

Please Help

Thanks.
 
G

Guest

You shouldn't have a space in the subform name. Change it to
pagosdet_subform3

Then on your main form create an unbound text box and use this as the
control source

=pagosdet_subform3!fieldname

Use the ! to seperate.
 
M

Marshall Barton

lalexander said:
I have a Form & Sub-Form

What is the proper syntax to reference a field in the sub-form or visa
versa.

I tried accessing the field from the subform below:

:: [Forms].[pagosdet subform3].[fieldname]

but this doesn't seems to work.

I need to put the value of a subform field into a variable and add that
variable to a field in the main-form.


take a look at:
http://www.mvps.org/access/forms/frm0031.htm
 
D

Duane Hookom

I'm not sure why you needed to add so many news groups to your question?
Surely "reports", "externaldata", and others are way off-topic. Please limit
your question to a single or maybe a couple appropriate news groups.

Try opening Help and typing in "referencing a control on a subform"
 
L

lalexander

Wayne,
Thanks for the reply.

I figured out why it wasn't working.

Seemed like I had another form called Sales that called the subform, so once
I added that
it worked , was just about to alert the newsgroup to cancel that posting.

I have the subform with spaces as shown below and that worked. In the
future I will
bear in mind not to leave spaces in the subform.

Thanks for your quick response.



example: =Forms!SALES![custord subform].Form!DepositAmount

Wayne-in-Manchester said:
You shouldn't have a space in the subform name. Change it to
pagosdet_subform3

Then on your main form create an unbound text box and use this as the
control source

=pagosdet_subform3!fieldname

Use the ! to seperate.


--
Wayne




lalexander said:
I have a Form & Sub-Form

What is the proper syntax to reference a field in the sub-form or visa
versa.

I tried accessing the field from the subform below:

:: [Forms].[pagosdet subform3].[fieldname]

but this doesn't seems to work.

I need to put the value of a subform field into a variable and add that
variable

to a field in the main-form.

Please Help

Thanks.
 

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