Sum Unbound Control on Continuous Form Footer? | | |
Hello,
I've used Sum() to total bound fields on a continuous form with no problem.
However, I now have a continuous form, on which I use an unbound field to
calculate the number of hours between two times stored in a record (bound
fields). This field is called txtDuration.
On my footer, I've created another unbound field named txtWeeklyTotal. I've
set the Control Source to =Sum([txtDuration]), but this returns a #Name?
error. I've tried [Me].[txtDuration] and it still doesn't seem to recognize
the unbound field.
Please, someone show me the error of my ways. This has been driving me
crazy for too long.
Thanks, as always! | | | | re: Sum Unbound Control on Continuous Form Footer?
Pat wrote:
[color=blue]
> Hello,
> I've used Sum() to total bound fields on a continuous form with no problem.
> However, I now have a continuous form, on which I use an unbound field to
> calculate the number of hours between two times stored in a record (bound
> fields). This field is called txtDuration.
>
> On my footer, I've created another unbound field named txtWeeklyTotal. I've
> set the Control Source to =Sum([txtDuration]), but this returns a #Name?
> error. I've tried [Me].[txtDuration] and it still doesn't seem to recognize
> the unbound field.
>
> Please, someone show me the error of my ways. This has been driving me
> crazy for too long.
>
> Thanks, as always![/color]
Since you are using a calculated field to be summed, don't use the name, use the
control souce.
=(Qry*Dollars) is the control source, name is Extended.
For the totals, enter
=Sum(Qty*Dollars)
not
=Sum(Extended) | | | | re: Sum Unbound Control on Continuous Form Footer?
Thanks for the reply. The field isn't calculated, as much as it's assigned
in VB. My calculation is done in the form's OnCurrent. The value is then
assigned to the unbound textbox.
Maybe I can compund the calculation in the form's record source query, but
I'll have to wait until tomorrow to try.
Any other suggestions?
"Salad" <oil@vinegar.com> wrote in message
news:401EF78E.555292FD@vinegar.com...[color=blue]
> Pat wrote:
>[color=green]
> > Hello,
> > I've used Sum() to total bound fields on a continuous form with no[/color][/color]
problem.[color=blue][color=green]
> > However, I now have a continuous form, on which I use an unbound field[/color][/color]
to[color=blue][color=green]
> > calculate the number of hours between two times stored in a record[/color][/color]
(bound[color=blue][color=green]
> > fields). This field is called txtDuration.
> >
> > On my footer, I've created another unbound field named txtWeeklyTotal.[/color][/color]
I've[color=blue][color=green]
> > set the Control Source to =Sum([txtDuration]), but this returns a #Name?
> > error. I've tried [Me].[txtDuration] and it still doesn't seem to[/color][/color]
recognize[color=blue][color=green]
> > the unbound field.
> >
> > Please, someone show me the error of my ways. This has been driving me
> > crazy for too long.
> >
> > Thanks, as always![/color]
>
> Since you are using a calculated field to be summed, don't use the name,[/color]
use the[color=blue]
> control souce.
>
> =(Qry*Dollars) is the control source, name is Extended.
>
> For the totals, enter
> =Sum(Qty*Dollars)
> not
> =Sum(Extended)
>
>[/color] | | | | re: Sum Unbound Control on Continuous Form Footer?
So, I played around and created the calculation within the underlying query,
instead of on the form. Now, I have no problems using Sum with the Bound
Field.
Thanks for the redirection.
"Pat" <noemail@ihatespam.bum> wrote in message
news:QtDTb.14104$2J1.8152@fe1.texas.rr.com...[color=blue]
> Thanks for the reply. The field isn't calculated, as much as it's[/color]
assigned[color=blue]
> in VB. My calculation is done in the form's OnCurrent. The value is then
> assigned to the unbound textbox.
>
> Maybe I can compund the calculation in the form's record source query, but
> I'll have to wait until tomorrow to try.
>
> Any other suggestions?
>
> "Salad" <oil@vinegar.com> wrote in message
> news:401EF78E.555292FD@vinegar.com...[color=green]
> > Pat wrote:
> >[color=darkred]
> > > Hello,
> > > I've used Sum() to total bound fields on a continuous form with no[/color][/color]
> problem.[color=green][color=darkred]
> > > However, I now have a continuous form, on which I use an unbound field[/color][/color]
> to[color=green][color=darkred]
> > > calculate the number of hours between two times stored in a record[/color][/color]
> (bound[color=green][color=darkred]
> > > fields). This field is called txtDuration.
> > >
> > > On my footer, I've created another unbound field named txtWeeklyTotal.[/color][/color]
> I've[color=green][color=darkred]
> > > set the Control Source to =Sum([txtDuration]), but this returns a[/color][/color][/color]
#Name?[color=blue][color=green][color=darkred]
> > > error. I've tried [Me].[txtDuration] and it still doesn't seem to[/color][/color]
> recognize[color=green][color=darkred]
> > > the unbound field.
> > >
> > > Please, someone show me the error of my ways. This has been driving[/color][/color][/color]
me[color=blue][color=green][color=darkred]
> > > crazy for too long.
> > >
> > > Thanks, as always![/color]
> >
> > Since you are using a calculated field to be summed, don't use the name,[/color]
> use the[color=green]
> > control souce.
> >
> > =(Qry*Dollars) is the control source, name is Extended.
> >
> > For the totals, enter
> > =Sum(Qty*Dollars)
> > not
> > =Sum(Extended)
> >
> >[/color]
>
>[/color] |  | Similar Microsoft Access / VBA bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,223 network members.
|