Get a total from a sub form backto the main form

  • Thread starter Thread starter SRussell
  • Start date Start date
S

SRussell

I have added another subform to the main form for this app. User wants to
see the total hours off of the sub form in a new textbox on the main.

any idea how to trap that the are done, or trap for the compute of nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart, Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to capture back
to the main form

TIA

__Stephen
 
put an unbound textbox control (name it txtStopNetTotal) in the footer
section of the subform; if you don't want the user to see it, set its'
Visible property to No. set the ControlSource property of the textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its' ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

note that you must substitute the correct name of the subform control. make
sure you use the name of the subform control, and NOT the name of the
subform as it shows in the database window - the two names are not always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll down to the
"Identify the correct name of a subform control" link, for illustrated
instructions.

hth
 
Thanks for the lead here!. I am close, but get an error.

tina said:
put an unbound textbox control (name it txtStopNetTotal) in the footer
section of the subform; if you don't want the user to see it, set its'
Visible property to No. set the ControlSource property of the textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its'
ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

Ok, I'm getting a #Name in the display of the form.

In it's control source:
=Text16.Stoppages!OnHoldTime
Text16 = Summary textbox on Stoppages form.
FrmJobEntry = Main Form's name.
Stoppages = SubForm on main Form
OnHoldTime = MainForm's Textbox name that I want to bind to, or it's the
name of the column of the data that I want to store the data to for the
client to report off of.

I have tried :
=Text16.Form!OnHoldTime
and
=Text16.FrmJobEntry!OnHoldTime
..
So what am I missing?

Thanks again.

__Stephen

note that you must substitute the correct name of the subform control.
make
sure you use the name of the subform control, and NOT the name of the
subform as it shows in the database window - the two names are not always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll down to
the
"Identify the correct name of a subform control" link, for illustrated
instructions.

hth


SRussell said:
I have added another subform to the main form for this app. User wants to
see the total hours off of the sub form in a new textbox on the main.

any idea how to trap that the are done, or trap for the compute of
nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart,
Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to capture back
to the main form

TIA

__Stephen
 
well you're welcome for the help. if you want sympathy for the error, then
you have my sympathy. if you want help in actually fixing the error, you'll
have to provide specific information about what you've done, and exactly
what the error is, and where and when you see it. remember that nobody in
the newsgroups can see your computer, or your database.


SRussell said:
Thanks for the lead here!. I am close, but get an error.

tina said:
put an unbound textbox control (name it txtStopNetTotal) in the footer
section of the subform; if you don't want the user to see it, set its'
Visible property to No. set the ControlSource property of the textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its'
ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

Ok, I'm getting a #Name in the display of the form.

In it's control source:
=Text16.Stoppages!OnHoldTime
Text16 = Summary textbox on Stoppages form.
FrmJobEntry = Main Form's name.
Stoppages = SubForm on main Form
OnHoldTime = MainForm's Textbox name that I want to bind to, or it's the
name of the column of the data that I want to store the data to for the
client to report off of.

I have tried :
=Text16.Form!OnHoldTime
and
=Text16.FrmJobEntry!OnHoldTime
.
So what am I missing?

Thanks again.

__Stephen

note that you must substitute the correct name of the subform control.
make
sure you use the name of the subform control, and NOT the name of the
subform as it shows in the database window - the two names are not always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll down to
the
"Identify the correct name of a subform control" link, for illustrated
instructions.

hth


SRussell said:
I have added another subform to the main form for this app. User
wants
to
see the total hours off of the sub form in a new textbox on the main.

any idea how to trap that the are done, or trap for the compute of
nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart,
Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to capture back
to the main form

TIA

__Stephen
 
tina said:
well you're welcome for the help. if you want sympathy for the error, then
you have my sympathy. if you want help in actually fixing the error,
you'll
have to provide specific information about what you've done, and exactly
what the error is, and where and when you see it. remember that nobody in
the newsgroups can see your computer, or your database.

Ok, Error is this text in the textbox of the main form shows this display:
#Name?

that control is named OnHoldtime.
Main Form is called FrmJobEntry

Control holding the sum on the subform Text16.

so I put in the control source for the main form:
=Text16.Stoppages!OnHoldTime

or a translation to :
=ControlOnSubForm.SubFormName!ControlOnMainForm

Am I missing something?

Thanks again!



SRussell said:
Thanks for the lead here!. I am close, but get an error.

tina said:
put an unbound textbox control (name it txtStopNetTotal) in the footer
section of the subform; if you don't want the user to see it, set its'
Visible property to No. set the ControlSource property of the textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its'
ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

Ok, I'm getting a #Name in the display of the form.

In it's control source:
=Text16.Stoppages!OnHoldTime
Text16 = Summary textbox on Stoppages form.
FrmJobEntry = Main Form's name.
Stoppages = SubForm on main Form
OnHoldTime = MainForm's Textbox name that I want to bind to, or it's the
name of the column of the data that I want to store the data to for the
client to report off of.

I have tried :
=Text16.Form!OnHoldTime
and
=Text16.FrmJobEntry!OnHoldTime
.
So what am I missing?

Thanks again.

__Stephen

note that you must substitute the correct name of the subform control.
make
sure you use the name of the subform control, and NOT the name of the
subform as it shows in the database window - the two names are not always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll down to
the
"Identify the correct name of a subform control" link, for illustrated
instructions.

hth


I have added another subform to the main form for this app. User wants
to
see the total hours off of the sub form in a new textbox on the main.

any idea how to trap that the are done, or trap for the compute of
nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart,
Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to capture
back
to the main form

TIA

__Stephen
 
in textbox control OnHoldtime, the syntax of the expression in the
ControlSource property should be

=[NameOfSubformControl].[Form]![Text16]

substitute the correct name of the subform control, of course.
"NameOfSubformControl" refers to the subform control, within the main form,
which is the "container" control that holds the subform object. if you don't
understand what i'm talking about, then see the illustrated instructions at
the link i gave you in my first post to this thread.

hth


SRussell said:
tina said:
well you're welcome for the help. if you want sympathy for the error, then
you have my sympathy. if you want help in actually fixing the error,
you'll
have to provide specific information about what you've done, and exactly
what the error is, and where and when you see it. remember that nobody in
the newsgroups can see your computer, or your database.

Ok, Error is this text in the textbox of the main form shows this display:
#Name?

that control is named OnHoldtime.
Main Form is called FrmJobEntry

Control holding the sum on the subform Text16.

so I put in the control source for the main form:
=Text16.Stoppages!OnHoldTime

or a translation to :
=ControlOnSubForm.SubFormName!ControlOnMainForm

Am I missing something?

Thanks again!



SRussell said:
Thanks for the lead here!. I am close, but get an error.

put an unbound textbox control (name it txtStopNetTotal) in the footer
section of the subform; if you don't want the user to see it, set its'
Visible property to No. set the ControlSource property of the textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its'
ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

Ok, I'm getting a #Name in the display of the form.

In it's control source:
=Text16.Stoppages!OnHoldTime
Text16 = Summary textbox on Stoppages form.
FrmJobEntry = Main Form's name.
Stoppages = SubForm on main Form
OnHoldTime = MainForm's Textbox name that I want to bind to, or it's the
name of the column of the data that I want to store the data to for the
client to report off of.

I have tried :
=Text16.Form!OnHoldTime
and
=Text16.FrmJobEntry!OnHoldTime
.
So what am I missing?

Thanks again.

__Stephen


note that you must substitute the correct name of the subform control.
make
sure you use the name of the subform control, and NOT the name of the
subform as it shows in the database window - the two names are not always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll down to
the
"Identify the correct name of a subform control" link, for illustrated
instructions.

hth


I have added another subform to the main form for this app. User wants
to
see the total hours off of the sub form in a new textbox on the main.

any idea how to trap that the are done, or trap for the compute of
nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart,
Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to capture
back
to the main form

TIA

__Stephen
 
tina said:
in textbox control OnHoldtime, the syntax of the expression in the
ControlSource property should be

=[NameOfSubformControl].[Form]![Text16]

I got IT! I kept seeing the word control and taking it to mean the textbox
and not the formname itself.

Thanks for your patience.
substitute the correct name of the subform control, of course.
"NameOfSubformControl" refers to the subform control, within the main
form,
which is the "container" control that holds the subform object. if you
don't
understand what i'm talking about, then see the illustrated instructions
at
the link i gave you in my first post to this thread.

hth


SRussell said:
tina said:
well you're welcome for the help. if you want sympathy for the error, then
you have my sympathy. if you want help in actually fixing the error,
you'll
have to provide specific information about what you've done, and
exactly
what the error is, and where and when you see it. remember that nobody in
the newsgroups can see your computer, or your database.

Ok, Error is this text in the textbox of the main form shows this
display:
#Name?

that control is named OnHoldtime.
Main Form is called FrmJobEntry

Control holding the sum on the subform Text16.

so I put in the control source for the main form:
=Text16.Stoppages!OnHoldTime

or a translation to :
=ControlOnSubForm.SubFormName!ControlOnMainForm

Am I missing something?

Thanks again!



Thanks for the lead here!. I am close, but get an error.

put an unbound textbox control (name it txtStopNetTotal) in the footer
section of the subform; if you don't want the user to see it, set its'
Visible property to No. set the ControlSource property of the
textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its'
ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

Ok, I'm getting a #Name in the display of the form.

In it's control source:
=Text16.Stoppages!OnHoldTime
Text16 = Summary textbox on Stoppages form.
FrmJobEntry = Main Form's name.
Stoppages = SubForm on main Form
OnHoldTime = MainForm's Textbox name that I want to bind to, or it's the
name of the column of the data that I want to store the data to for
the
client to report off of.

I have tried :
=Text16.Form!OnHoldTime
and
=Text16.FrmJobEntry!OnHoldTime
.
So what am I missing?

Thanks again.

__Stephen


note that you must substitute the correct name of the subform control.
make
sure you use the name of the subform control, and NOT the name of
the
subform as it shows in the database window - the two names are not
always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll down to
the
"Identify the correct name of a subform control" link, for illustrated
instructions.

hth


I have added another subform to the main form for this app. User
wants
to
see the total hours off of the sub form in a new textbox on the main.

any idea how to trap that the are done, or trap for the compute of
nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart,
Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to capture
back
to the main form

TIA

__Stephen
 
well, you're welcome, but you haven't quite got it. i was NOT talking about
"the formname itself", i am talking about the *subform CONTROL name* within
the main form. the reason using the formname worked for you is that
apparently the name of your subform object, and the name of the subform
control, are the same. but that is not always the case, so i still advise
you to see the link i posted and make sure you understand what a subform
control is, and how to find its' name.

hth


SRussell said:
tina said:
in textbox control OnHoldtime, the syntax of the expression in the
ControlSource property should be

=[NameOfSubformControl].[Form]![Text16]

I got IT! I kept seeing the word control and taking it to mean the textbox
and not the formname itself.

Thanks for your patience.
substitute the correct name of the subform control, of course.
"NameOfSubformControl" refers to the subform control, within the main
form,
which is the "container" control that holds the subform object. if you
don't
understand what i'm talking about, then see the illustrated instructions
at
the link i gave you in my first post to this thread.

hth


SRussell said:
well you're welcome for the help. if you want sympathy for the error, then
you have my sympathy. if you want help in actually fixing the error,
you'll
have to provide specific information about what you've done, and
exactly
what the error is, and where and when you see it. remember that
nobody
in
the newsgroups can see your computer, or your database.

Ok, Error is this text in the textbox of the main form shows this
display:
#Name?

that control is named OnHoldtime.
Main Form is called FrmJobEntry

Control holding the sum on the subform Text16.

so I put in the control source for the main form:
=Text16.Stoppages!OnHoldTime

or a translation to :
=ControlOnSubForm.SubFormName!ControlOnMainForm

Am I missing something?

Thanks again!




Thanks for the lead here!. I am close, but get an error.

put an unbound textbox control (name it txtStopNetTotal) in the footer
section of the subform; if you don't want the user to see it, set its'
Visible property to No. set the ControlSource property of the
textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its'
ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

Ok, I'm getting a #Name in the display of the form.

In it's control source:
=Text16.Stoppages!OnHoldTime
Text16 = Summary textbox on Stoppages form.
FrmJobEntry = Main Form's name.
Stoppages = SubForm on main Form
OnHoldTime = MainForm's Textbox name that I want to bind to, or it's the
name of the column of the data that I want to store the data to for
the
client to report off of.

I have tried :
=Text16.Form!OnHoldTime
and
=Text16.FrmJobEntry!OnHoldTime
.
So what am I missing?

Thanks again.

__Stephen


note that you must substitute the correct name of the subform control.
make
sure you use the name of the subform control, and NOT the name of
the
subform as it shows in the database window - the two names are not
always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll
down
to
the
"Identify the correct name of a subform control" link, for illustrated
instructions.

hth


I have added another subform to the main form for this app. User
wants
to
see the total hours off of the sub form in a new textbox on the main.

any idea how to trap that the are done, or trap for the compute of
nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart,
Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to capture
back
to the main form

TIA

__Stephen
 
tina said:
well, you're welcome, but you haven't quite got it. i was NOT talking
about
"the formname itself", i am talking about the *subform CONTROL name*
within
the main form. the reason using the formname worked for you is that
apparently the name of your subform object, and the name of the subform
control, are the same. but that is not always the case, so i still advise
you to see the link i posted and make sure you understand what a subform
control is, and how to find its' name.

I did go to that site twice. I understand what your saying. Thanks again.
SRussell said:
tina said:
in textbox control OnHoldtime, the syntax of the expression in the
ControlSource property should be

=[NameOfSubformControl].[Form]![Text16]

I got IT! I kept seeing the word control and taking it to mean the textbox
and not the formname itself.

Thanks for your patience.
substitute the correct name of the subform control, of course.
"NameOfSubformControl" refers to the subform control, within the main
form,
which is the "container" control that holds the subform object. if you
don't
understand what i'm talking about, then see the illustrated
instructions
at
the link i gave you in my first post to this thread.

hth



well you're welcome for the help. if you want sympathy for the
error,
then
you have my sympathy. if you want help in actually fixing the error,
you'll
have to provide specific information about what you've done, and
exactly
what the error is, and where and when you see it. remember that nobody
in
the newsgroups can see your computer, or your database.

Ok, Error is this text in the textbox of the main form shows this
display:
#Name?

that control is named OnHoldtime.
Main Form is called FrmJobEntry

Control holding the sum on the subform Text16.

so I put in the control source for the main form:
=Text16.Stoppages!OnHoldTime

or a translation to :
=ControlOnSubForm.SubFormName!ControlOnMainForm

Am I missing something?

Thanks again!




Thanks for the lead here!. I am close, but get an error.

put an unbound textbox control (name it txtStopNetTotal) in the
footer
section of the subform; if you don't want the user to see it, set
its'
Visible property to No. set the ControlSource property of the
textbox
control to

=Sum([StopNet]).

in the main form, add an unbound textbox control, and set its'
ControlSource
property to

=[NameOfSubformControl].[Form]![txtStopNetTotal]

Ok, I'm getting a #Name in the display of the form.

In it's control source:
=Text16.Stoppages!OnHoldTime
Text16 = Summary textbox on Stoppages form.
FrmJobEntry = Main Form's name.
Stoppages = SubForm on main Form
OnHoldTime = MainForm's Textbox name that I want to bind to, or
it's
the
name of the column of the data that I want to store the data to for
the
client to report off of.

I have tried :
=Text16.Form!OnHoldTime
and
=Text16.FrmJobEntry!OnHoldTime
.
So what am I missing?

Thanks again.

__Stephen


note that you must substitute the correct name of the subform
control.
make
sure you use the name of the subform control, and NOT the name of
the
subform as it shows in the database window - the two names are
not
always
the same. if you're not sure how to get the correct name, see
http://home.att.net/~california.db/instructions.html and scroll down
to
the
"Identify the correct name of a subform control" link, for
illustrated
instructions.

hth


I have added another subform to the main form for this app. User
wants
to
see the total hours off of the sub form in a new textbox on the
main.

any idea how to trap that the are done, or trap for the compute of
nettime
takes place?

In the filed list
SELECT Stoppages.ROnumber, Stoppages.StopTimeStart,
Stoppages.StopTimeEnd,
DateDiff("n",[StopTimeStart],[StopTimeEnd])/60 AS StopNet,
Stoppages.StopTypeId FROM Stoppages;

you can see the datediff is used. That is what I am trying to
capture
back
to the main form

TIA

__Stephen
 
Back
Top