A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

counting and placing answer in text box



 
 
Thread Tools Display Modes
  #1  
Old July 9th, 2009, 06:49 PM posted to microsoft.public.access
Bigmac
external usenet poster
 
Posts: 12
Default counting and placing answer in text box

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the input
tbl), on the sub form there is [am] and [pm] fields, both lookup and can
contain one of the following, "absent","present","placement", holiday"or
bank holiday. what i am trying to do is on the main form show the total for
each , total absent, total holiday,etc, but only for the id shown on the form
example id1 shows all absents,holidays,placements etc for that particular
id, also last bit, can this be done so that it automaticaly updates after
each new field input?
i do not know any vba , and as for epressions i am just learning so please
can you make them clear for me to try and learn what you are showing me.
regards mac
learner ,please be patient
  #3  
Old July 10th, 2009, 06:36 PM posted to microsoft.public.access
Bigmac
external usenet poster
 
Posts: 12
Default counting and placing answer in text box

i have tried the dcount and cannot get it to work (my one brain cell still
sleeping),but what i have managed to learn is that if i make a crosstab query
and use forms![main form]![id] in the id criteria box and then in the am
criteria box of the am field i put "absent" and count in the next totals row
then this will show the total amount of "absents" in the result, but how do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount in the
Help file and see if you can get it to work. If you have trouble, post back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the input
tbl), on the sub form there is [am] and [pm] fields, both lookup and can
contain one of the following, "absent","present","placement", holiday"or
bank holiday. what i am trying to do is on the main form show the total
for
each , total absent, total holiday,etc, but only for the id shown on the
form
example id1 shows all absents,holidays,placements etc for that particular
id, also last bit, can this be done so that it automaticaly updates after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing me.
regards mac
learner ,please be patient




  #4  
Old July 10th, 2009, 06:39 PM posted to microsoft.public.access
Bigmac
external usenet poster
 
Posts: 12
Default counting and placing answer in text box

i have tried the dcount and cannot get it to work (my one brain cell still
sleeping),but what i have managed to learn is that if i make a crosstab query
and use forms![main form]![id] in the id criteria box and then in the am
criteria box of the am field i put "absent" and count in the next totals row
then this will show the total amount of "absents" in the result, but how do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount in the
Help file and see if you can get it to work. If you have trouble, post back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the input
tbl), on the sub form there is [am] and [pm] fields, both lookup and can
contain one of the following, "absent","present","placement", holiday"or
bank holiday. what i am trying to do is on the main form show the total
for
each , total absent, total holiday,etc, but only for the id shown on the
form
example id1 shows all absents,holidays,placements etc for that particular
id, also last bit, can this be done so that it automaticaly updates after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing me.
regards mac
learner ,please be patient




  #5  
Old July 10th, 2009, 06:39 PM posted to microsoft.public.access
Bigmac
external usenet poster
 
Posts: 12
Default counting and placing answer in text box

i have tried the dcount and cannot get it to work (my one brain cell still
sleeping),but what i have managed to learn is that if i make a crosstab query
and use forms![main form]![id] in the id criteria box and then in the am
criteria box of the am field i put "absent" and count in the next totals row
then this will show the total amount of "absents" in the result, but how do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount in the
Help file and see if you can get it to work. If you have trouble, post back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the input
tbl), on the sub form there is [am] and [pm] fields, both lookup and can
contain one of the following, "absent","present","placement", holiday"or
bank holiday. what i am trying to do is on the main form show the total
for
each , total absent, total holiday,etc, but only for the id shown on the
form
example id1 shows all absents,holidays,placements etc for that particular
id, also last bit, can this be done so that it automaticaly updates after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing me.
regards mac
learner ,please be patient




  #6  
Old July 10th, 2009, 07:18 PM posted to microsoft.public.access
Steve[_72_]
external usenet poster
 
Posts: 190
Default counting and placing answer in text box

Assuming your InputTbl table has a field named "Status", do the following:

Add a text box to your main form and label it Total Absent. Put the
following in the Control Source property of the text box:

=DCount("[Status]","InputTbl","[ID] = " & Forms![MainForm]![ID] & " AND
[Status] = 'Status'"

Note: That is a single quote and double quote at the end.

Do the same for the other statuses.

Steve



"bigmac" wrote in message
...
i have tried the dcount and cannot get it to work (my one brain cell still
sleeping),but what i have managed to learn is that if i make a crosstab
query
and use forms![main form]![id] in the id criteria box and then in the
am
criteria box of the am field i put "absent" and count in the next totals
row
then this will show the total amount of "absents" in the result, but how
do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount in
the
Help file and see if you can get it to work. If you have trouble, post
back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the input
tbl), on the sub form there is [am] and [pm] fields, both lookup and
can
contain one of the following, "absent","present","placement",
holiday"or
bank holiday. what i am trying to do is on the main form show the total
for
each , total absent, total holiday,etc, but only for the id shown on
the
form
example id1 shows all absents,holidays,placements etc for that
particular
id, also last bit, can this be done so that it automaticaly updates
after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing
me.
regards mac
learner ,please be patient






  #7  
Old July 10th, 2009, 08:35 PM posted to microsoft.public.access
BruceM[_4_]
external usenet poster
 
Posts: 558
Default counting and placing answer in text box

Assuming the expression is otherwise correct, add a closing parentheses

"Steve" help_available_at_very_reasonable_rates@contactme .com wrote in
message m...
Assuming your InputTbl table has a field named "Status", do the following:

Add a text box to your main form and label it Total Absent. Put the
following in the Control Source property of the text box:

=DCount("[Status]","InputTbl","[ID] = " & Forms![MainForm]![ID] & " AND
[Status] = 'Status'"

Note: That is a single quote and double quote at the end.

Do the same for the other statuses.

Steve



"bigmac" wrote in message
...
i have tried the dcount and cannot get it to work (my one brain cell still
sleeping),but what i have managed to learn is that if i make a crosstab
query
and use forms![main form]![id] in the id criteria box and then in the
am
criteria box of the am field i put "absent" and count in the next totals
row
then this will show the total amount of "absents" in the result, but
how do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount in
the
Help file and see if you can get it to work. If you have trouble, post
back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the
input
tbl), on the sub form there is [am] and [pm] fields, both lookup and
can
contain one of the following, "absent","present","placement",
holiday"or
bank holiday. what i am trying to do is on the main form show the
total
for
each , total absent, total holiday,etc, but only for the id shown on
the
form
example id1 shows all absents,holidays,placements etc for that
particular
id, also last bit, can this be done so that it automaticaly updates
after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing
me.
regards mac
learner ,please be patient







  #8  
Old July 10th, 2009, 09:19 PM posted to microsoft.public.access
Bigmac
external usenet poster
 
Posts: 12
Default counting and placing answer in text box

hi steve the only fields i have in my inputtbl are, id,am,and pm so what do i
use instead of status? also am i right in thinking that this expression will
return the total of "absent" in the am field and place the total on my main
form?
--
learner ,please be patient


"Steve" wrote:

Assuming your InputTbl table has a field named "Status", do the following:

Add a text box to your main form and label it Total Absent. Put the
following in the Control Source property of the text box:

=DCount("[Status]","InputTbl","[ID] = " & Forms![MainForm]![ID] & " AND
[Status] = 'Status'"

Note: That is a single quote and double quote at the end.

Do the same for the other statuses.

Steve



"bigmac" wrote in message
...
i have tried the dcount and cannot get it to work (my one brain cell still
sleeping),but what i have managed to learn is that if i make a crosstab
query
and use forms![main form]![id] in the id criteria box and then in the
am
criteria box of the am field i put "absent" and count in the next totals
row
then this will show the total amount of "absents" in the result, but how
do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount in
the
Help file and see if you can get it to work. If you have trouble, post
back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the input
tbl), on the sub form there is [am] and [pm] fields, both lookup and
can
contain one of the following, "absent","present","placement",
holiday"or
bank holiday. what i am trying to do is on the main form show the total
for
each , total absent, total holiday,etc, but only for the id shown on
the
form
example id1 shows all absents,holidays,placements etc for that
particular
id, also last bit, can this be done so that it automaticaly updates
after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing
me.
regards mac
learner ,please be patient






  #9  
Old July 10th, 2009, 09:46 PM posted to microsoft.public.access
Steve[_72_]
external usenet poster
 
Posts: 190
Default counting and placing answer in text box

First, I made a mistake at the end of the expression. [Status] = 'Status'"
should have been [Status] = 'Absent'"

Now, Bruce is correct about the closing parantheses. The above should have
been:
[Status] = 'Absent'")

Finally, with your clarificfation, put the following in the Control Source
of the textbox:
=DCount("[AM]","InputTbl","[ID] = " & Forms![MainForm]![ID] & " AND [AM] =
'Absent'") +
DCount("[PM]","InputTbl","[ID] = " & Forms![MainForm]![ID] & " AND [PM] =
'Absent'")

To answer your question, the above will total "Absent" for both AM and PM.
If you only want AM or PM, omit the apprpriate part in the expression above.

Steve

"bigmac" wrote in message
news
hi steve the only fields i have in my inputtbl are, id,am,and pm so what
do i
use instead of status? also am i right in thinking that this expression
will
return the total of "absent" in the am field and place the total on my
main
form?
--
learner ,please be patient


"Steve" wrote:

Assuming your InputTbl table has a field named "Status", do the
following:

Add a text box to your main form and label it Total Absent. Put the
following in the Control Source property of the text box:

=DCount("[Status]","InputTbl","[ID] = " & Forms![MainForm]![ID] & " AND
[Status] = 'Status'"

Note: That is a single quote and double quote at the end.

Do the same for the other statuses.

Steve



"bigmac" wrote in message
...
i have tried the dcount and cannot get it to work (my one brain cell
still
sleeping),but what i have managed to learn is that if i make a crosstab
query
and use forms![main form]![id] in the id criteria box and then in the
am
criteria box of the am field i put "absent" and count in the next
totals
row
then this will show the total amount of "absents" in the result, but
how
do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount
in
the
Help file and see if you can get it to work. If you have trouble, post
back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the
input
tbl), on the sub form there is [am] and [pm] fields, both lookup and
can
contain one of the following, "absent","present","placement",
holiday"or
bank holiday. what i am trying to do is on the main form show the
total
for
each , total absent, total holiday,etc, but only for the id shown on
the
form
example id1 shows all absents,holidays,placements etc for that
particular
id, also last bit, can this be done so that it automaticaly updates
after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing
me.
regards mac
learner ,please be patient








  #10  
Old July 13th, 2009, 06:56 PM posted to microsoft.public.access
Bigmac
external usenet poster
 
Posts: 12
Default counting and placing answer in text box

chers steve worked well thanks
--
learner ,please be patient


"bigmac" wrote:

i have tried the dcount and cannot get it to work (my one brain cell still
sleeping),but what i have managed to learn is that if i make a crosstab query
and use forms![main form]![id] in the id criteria box and then in the am
criteria box of the am field i put "absent" and count in the next totals row
then this will show the total amount of "absents" in the result, but how do
i get the totals onto my main form?
--
learner ,please be patient


"Steve" wrote:

Access has a DCount function that will do this for you. Lookup DCount in the
Help file and see if you can get it to work. If you have trouble, post back.

Steve




"bigmac" wrote in message
...

hello i have two tables[mastertbl] and [inputtbl] ,both joined in a
relationship by [id]fields,(one is a primarykey).
and two forms[main form] and a subform[mainsubform](made from the input
tbl), on the sub form there is [am] and [pm] fields, both lookup and can
contain one of the following, "absent","present","placement", holiday"or
bank holiday. what i am trying to do is on the main form show the total
for
each , total absent, total holiday,etc, but only for the id shown on the
form
example id1 shows all absents,holidays,placements etc for that particular
id, also last bit, can this be done so that it automaticaly updates after
each new field input?
i do not know any vba , and as for epressions i am just learning so
please
can you make them clear for me to try and learn what you are showing me.
regards mac
learner ,please be patient




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.