Number setting

F

fishqqq

I should know this but for the life of me i can't figure this out.

In my table i have a Number field and in the form i have it attached
to a checkbox.

I intend to have the user check the checkbox and then i wish to sum up
all of the checks to get a total

the problem is if the box is checked it enters "-1" in the table, when
i do my total query it returns -20 etc instead of 20

how do i get rid of that minus sign or better still how do i get the
table to return a positive number when then box is checked in the
form?

all suggestions are appreciated!
tks
Steve
 
F

FatMan

Steve:
If I understand you correctly it sounds like what you want to do is count
the number of check boxes that have been checked. If this is the case then
you could try adding a text box to your form and enter the following in the
text box:

=dcount(“[CheckBoxFieldName]â€,[“TableName]â€,â€[ CheckBoxFieldName]â€)

You would also need to enter a small piece of code in the after update event
for the “CheckBoxFieldNameâ€. The code would be:

me.recalc

Each time someone checks or unchecks the check box the text box you added
above will change to reflect the number of boxes that are currently checked.

Hope this helps,
FatMan
 
F

FatMan

Steve:
If I understand you correctly it sounds like what you want to do is count
the number of check boxes that have been checked. If this is the case then
you could try adding a text box to your form and enter the following in the
text box:

=dcount(“[CheckBoxFieldName]â€,[“TableName]â€,â€[ CheckBoxFieldName]â€)

You would also need to enter a small piece of code in the after update event
for the “CheckBoxFieldNameâ€. The code would be:

me.recalc

Each time someone checks or unchecks the check box the text box you added
above will change to reflect the number of boxes that are currently checked.

Hope this helps,
FatMan
 
F

FatMan

Steve:
If I understand you correctly it sounds like what you want to do is count
the number of check boxes that have been checked. If this is the case then
you could try adding a text box to your form and enter the following in the
text box:

=dcount(“[CheckBoxFieldName]â€,[“TableName]â€,â€[ CheckBoxFieldName]â€)

You would also need to enter a small piece of code in the after update event
for the “CheckBoxFieldNameâ€. The code would be:

me.recalc

Each time someone checks or unchecks the check box the text box you added
above will change to reflect the number of boxes that are currently checked.

Hope this helps,
FatMan
 
J

John W. Vinson

I should know this but for the life of me i can't figure this out.

In my table i have a Number field and in the form i have it attached
to a checkbox.

I intend to have the user check the checkbox and then i wish to sum up
all of the checks to get a total

the problem is if the box is checked it enters "-1" in the table, when
i do my total query it returns -20 etc instead of 20

how do i get rid of that minus sign or better still how do i get the
table to return a positive number when then box is checked in the
form?

all suggestions are appreciated!
tks
Steve

A Checkbox control has only two values - 0 (false, unchecked) and -1 (true,
checked).

Simply use -Sum([checkbox]) or Sum(Abs([checkbox])) in your total query.
 

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