Pulling a formula from Subform to Main Form

  • Thread starter Thread starter SamDev
  • Start date Start date
S

SamDev

In a Subform I have created a text box with an unbound box in a Form Footer
that = sum(nz([amt]))-sum(nz([payment])). Name is "outstanding".

In the subform's footer the formula works just fine. In the subform detail
section I created a text box with unbound box and insert =[outstanding] and
it works. So I know the name [outstanding] is valid.

What I want to do, and I have done this many times in other databases, is in
the detail section of the main form display the results of [outstanding].
What I have done in the past is the following:

=[Subform Name].Form![Outstanding]

And, this has worked but not in the particular database - any ideas - much
appreciated.

I am using Access 2002 - which I am finding has many weird "bugs".

Thx,
 
The name of the subform control may be different from the name of the form
it contains (its SourceObject).

Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is its Name?
 
The name is "Outstanding" - this is the name of the control in the subform
(in the footer of the subform) - when I open up the Main form in design view
and open Properties of the subform control.

I have checked my spelling - even used the Expression Builder and keep
getting the #Name? message in the control box in Form View.

???

Allen Browne said:
The name of the subform control may be different from the name of the form
it contains (its SourceObject).

Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is its Name?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

SamDev said:
In a Subform I have created a text box with an unbound box in a Form Footer
that = sum(nz([amt]))-sum(nz([payment])). Name is "outstanding".

In the subform's footer the formula works just fine. In the subform detail
section I created a text box with unbound box and insert =[outstanding] and
it works. So I know the name [outstanding] is valid.

What I want to do, and I have done this many times in other databases,
is
in
the detail section of the main form display the results of [outstanding].
What I have done in the past is the following:

=[Subform Name].Form![Outstanding]

And, this has worked but not in the particular database - any ideas - much
appreciated.

I am using Access 2002 - which I am finding has many weird "bugs".

Thx,
 
We are talking about the name of the subform-type control (not the name of
the control in the form in the subform control).

If you can't get at the subform control, try this:
1. Open the subform in design view, directly from the database window.

2. Now open the main form in design view. You will see the subform control
shown as a white space. Check the Name property of this control (the white
space representing the subform).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

SamDev said:
The name is "Outstanding" - this is the name of the control in the subform
(in the footer of the subform) - when I open up the Main form in design view
and open Properties of the subform control.

I have checked my spelling - even used the Expression Builder and keep
getting the #Name? message in the control box in Form View.

???

Allen Browne said:
The name of the subform control may be different from the name of the form
it contains (its SourceObject).

Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is its Name?

SamDev said:
In a Subform I have created a text box with an unbound box in a Form Footer
that = sum(nz([amt]))-sum(nz([payment])). Name is "outstanding".

In the subform's footer the formula works just fine. In the subform detail
section I created a text box with unbound box and insert
=[outstanding]
and
it works. So I know the name [outstanding] is valid.

What I want to do, and I have done this many times in other databases,
is
in
the detail section of the main form display the results of [outstanding].
What I have done in the past is the following:

=[Subform Name].Form![Outstanding]

And, this has worked but not in the particular database - any ideas - much
appreciated.

I am using Access 2002 - which I am finding has many weird "bugs".

Thx,
 
Sorry about that...

The name on the subform control is the same name I'm using in for example:

=[Subform Name].Form![Outstanding]

The subform name = "subform name"


Allen Browne said:
We are talking about the name of the subform-type control (not the name of
the control in the form in the subform control).

If you can't get at the subform control, try this:
1. Open the subform in design view, directly from the database window.

2. Now open the main form in design view. You will see the subform control
shown as a white space. Check the Name property of this control (the white
space representing the subform).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

SamDev said:
The name is "Outstanding" - this is the name of the control in the subform
(in the footer of the subform) - when I open up the Main form in design view
and open Properties of the subform control.

I have checked my spelling - even used the Expression Builder and keep
getting the #Name? message in the control box in Form View.

???

Allen Browne said:
The name of the subform control may be different from the name of the form
it contains (its SourceObject).

Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is its Name?

In a Subform I have created a text box with an unbound box in a Form
Footer
that = sum(nz([amt]))-sum(nz([payment])). Name is "outstanding".

In the subform's footer the formula works just fine. In the subform detail
section I created a text box with unbound box and insert =[outstanding]
and
it works. So I know the name [outstanding] is valid.

What I want to do, and I have done this many times in other
databases,
is
in
the detail section of the main form display the results of [outstanding].
What I have done in the past is the following:

=[Subform Name].Form![Outstanding]

And, this has worked but not in the particular database - any
ideas -
much
appreciated.

I am using Access 2002 - which I am finding has many weird "bugs".

Thx,
 
Okay, to find which piece of the puzzle is wrong, let's use the Debug
Window.

1. Open the form.

2. Press Ctrl+G to open the Immediate Window.

3. Enter:
? Forms![YourMainFormNameHere].[Subform Name].ControlType
That should return 112 if you have a subform control named "Subform Name".

4. If that works, try:
? Forms![YourMainFormNameHere].[Subform
Name].Form![Outstanding].ControlType
That should return 109 if it is a text box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

SamDev said:
Sorry about that...

The name on the subform control is the same name I'm using in for example:

=[Subform Name].Form![Outstanding]

The subform name = "subform name"


Allen Browne said:
We are talking about the name of the subform-type control (not the name of
the control in the form in the subform control).

If you can't get at the subform control, try this:
1. Open the subform in design view, directly from the database window.

2. Now open the main form in design view. You will see the subform control
shown as a white space. Check the Name property of this control (the white
space representing the subform).

SamDev said:
The name is "Outstanding" - this is the name of the control in the subform
(in the footer of the subform) - when I open up the Main form in
design
view
and open Properties of the subform control.

I have checked my spelling - even used the Expression Builder and keep
getting the #Name? message in the control box in Form View.

???

The name of the subform control may be different from the name of
the
form
it contains (its SourceObject).

Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is its Name?

In a Subform I have created a text box with an unbound box in a Form
Footer
that = sum(nz([amt]))-sum(nz([payment])). Name is "outstanding".

In the subform's footer the formula works just fine. In the subform
detail
section I created a text box with unbound box and insert =[outstanding]
and
it works. So I know the name [outstanding] is valid.

What I want to do, and I have done this many times in other databases,
is
in
the detail section of the main form display the results of
[outstanding].
What I have done in the past is the following:

=[Subform Name].Form![Outstanding]

And, this has worked but not in the particular database - any ideas -
much
appreciated.

I am using Access 2002 - which I am finding has many weird "bugs".

Thx,
 
Well, with your help I finally got it to work - the name was "child24" not
the name I was seeing as the name of the subform. Thank you so much - this
has never happened to me - again, much thanks!!!


Allen Browne said:
Okay, to find which piece of the puzzle is wrong, let's use the Debug
Window.

1. Open the form.

2. Press Ctrl+G to open the Immediate Window.

3. Enter:
? Forms![YourMainFormNameHere].[Subform Name].ControlType
That should return 112 if you have a subform control named "Subform Name".

4. If that works, try:
? Forms![YourMainFormNameHere].[Subform
Name].Form![Outstanding].ControlType
That should return 109 if it is a text box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

SamDev said:
Sorry about that...

The name on the subform control is the same name I'm using in for example:

=[Subform Name].Form![Outstanding]

The subform name = "subform name"


Allen Browne said:
We are talking about the name of the subform-type control (not the
name
of
the control in the form in the subform control).

If you can't get at the subform control, try this:
1. Open the subform in design view, directly from the database window.

2. Now open the main form in design view. You will see the subform control
shown as a white space. Check the Name property of this control (the white
space representing the subform).

The name is "Outstanding" - this is the name of the control in the subform
(in the footer of the subform) - when I open up the Main form in design
view
and open Properties of the subform control.

I have checked my spelling - even used the Expression Builder and keep
getting the #Name? message in the control box in Form View.

???

The name of the subform control may be different from the name of the
form
it contains (its SourceObject).

Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is its Name?

In a Subform I have created a text box with an unbound box in a Form
Footer
that = sum(nz([amt]))-sum(nz([payment])). Name is "outstanding".

In the subform's footer the formula works just fine. In the subform
detail
section I created a text box with unbound box and insert
=[outstanding]
and
it works. So I know the name [outstanding] is valid.

What I want to do, and I have done this many times in other databases,
is
in
the detail section of the main form display the results of
[outstanding].
What I have done in the past is the following:

=[Subform Name].Form![Outstanding]

And, this has worked but not in the particular database - any ideas -
much
appreciated.

I am using Access 2002 - which I am finding has many weird "bugs".

Thx,
 
Back
Top