Counting Check Boxes

N

Nick CWT

In database #1 report I use the following expression to count checked check
boxes and it works.

=Sum([Attachment Pre-test Completed Child1]+[Attachment Pre-test Completed
Child2]+[Attachment Pre-test Completed Child3]+[Attachment Pre-test Completed
Child4]+[Attachment Pre-test Completed Child5]+[Attachment Pre-test Completed
Child6]+[Attachment Pre-test Completed Child7]+[Attachment Pre-test Completed
Child8])*-1

When I exported this report to database #2 I get #Error in Print / Print
Preview? As always I'm stumped. Thanks in advance for any help.
 
O

Ofer Cohen

Does DataBase#2 has the same data?
Make sure that the fieds name are the same
Make sure that the control source of the report include all the fields

And try convrting Null into 0, incase there is a null in the Yes/No field

=Sum(Abs(Nz([Attachment Pre-test Completed Child1],0)+Nz([Attachment
Pre-test Completed Child2], 0)+Nz([Attachment Pre-test Completed
Child3],0)+Nz([Attachment Pre-test Completed Child4],0)+Nz([Attachment
Pre-test Completed Child5],0)+Nz([Attachment Pre-test Completed
Child6],0)+Nz([Attachment Pre-test Completed Child7],0)+Nz([Attachment
Pre-test Completed Child8],0))

Note: the Abs (Absolute) use to change negetive to positive, instead of *-1
 
N

Nick CWT

Thanks for your reply, sorry for my delay in responding. I've checked what
you suggested but have not figured it out yet. I think my problem is related
to the fact that my version of Access (2003) is different then the server
that I'm exporting the reports to. How do you convert Null into 0? I'm very
appreciative of any help. Thanks.

Ofer Cohen said:
Does DataBase#2 has the same data?
Make sure that the fieds name are the same
Make sure that the control source of the report include all the fields

And try convrting Null into 0, incase there is a null in the Yes/No field

=Sum(Abs(Nz([Attachment Pre-test Completed Child1],0)+Nz([Attachment
Pre-test Completed Child2], 0)+Nz([Attachment Pre-test Completed
Child3],0)+Nz([Attachment Pre-test Completed Child4],0)+Nz([Attachment
Pre-test Completed Child5],0)+Nz([Attachment Pre-test Completed
Child6],0)+Nz([Attachment Pre-test Completed Child7],0)+Nz([Attachment
Pre-test Completed Child8],0))

Note: the Abs (Absolute) use to change negetive to positive, instead of *-1

--
Good Luck
BS"D


Nick CWT said:
In database #1 report I use the following expression to count checked check
boxes and it works.

=Sum([Attachment Pre-test Completed Child1]+[Attachment Pre-test Completed
Child2]+[Attachment Pre-test Completed Child3]+[Attachment Pre-test Completed
Child4]+[Attachment Pre-test Completed Child5]+[Attachment Pre-test Completed
Child6]+[Attachment Pre-test Completed Child7]+[Attachment Pre-test Completed
Child8])*-1

When I exported this report to database #2 I get #Error in Print / Print
Preview? As always I'm stumped. Thanks in advance for any help.
 
O

Ofer Cohen

Hi,
to convert Null into 0, you can use the Nz function

Nz([FieldName],0)

You can actualy use it to convert Null into any value
Nz([FieldName],"NA")

--
Good Luck
BS"D


Nick CWT said:
Thanks for your reply, sorry for my delay in responding. I've checked what
you suggested but have not figured it out yet. I think my problem is related
to the fact that my version of Access (2003) is different then the server
that I'm exporting the reports to. How do you convert Null into 0? I'm very
appreciative of any help. Thanks.

Ofer Cohen said:
Does DataBase#2 has the same data?
Make sure that the fieds name are the same
Make sure that the control source of the report include all the fields

And try convrting Null into 0, incase there is a null in the Yes/No field

=Sum(Abs(Nz([Attachment Pre-test Completed Child1],0)+Nz([Attachment
Pre-test Completed Child2], 0)+Nz([Attachment Pre-test Completed
Child3],0)+Nz([Attachment Pre-test Completed Child4],0)+Nz([Attachment
Pre-test Completed Child5],0)+Nz([Attachment Pre-test Completed
Child6],0)+Nz([Attachment Pre-test Completed Child7],0)+Nz([Attachment
Pre-test Completed Child8],0))

Note: the Abs (Absolute) use to change negetive to positive, instead of *-1

--
Good Luck
BS"D


Nick CWT said:
In database #1 report I use the following expression to count checked check
boxes and it works.

=Sum([Attachment Pre-test Completed Child1]+[Attachment Pre-test Completed
Child2]+[Attachment Pre-test Completed Child3]+[Attachment Pre-test Completed
Child4]+[Attachment Pre-test Completed Child5]+[Attachment Pre-test Completed
Child6]+[Attachment Pre-test Completed Child7]+[Attachment Pre-test Completed
Child8])*-1

When I exported this report to database #2 I get #Error in Print / Print
Preview? As always I'm stumped. Thanks in advance for any help.
 
N

Nick CWT

Thanks very much.

Ofer Cohen said:
Hi,
to convert Null into 0, you can use the Nz function

Nz([FieldName],0)

You can actualy use it to convert Null into any value
Nz([FieldName],"NA")

--
Good Luck
BS"D


Nick CWT said:
Thanks for your reply, sorry for my delay in responding. I've checked what
you suggested but have not figured it out yet. I think my problem is related
to the fact that my version of Access (2003) is different then the server
that I'm exporting the reports to. How do you convert Null into 0? I'm very
appreciative of any help. Thanks.

Ofer Cohen said:
Does DataBase#2 has the same data?
Make sure that the fieds name are the same
Make sure that the control source of the report include all the fields

And try convrting Null into 0, incase there is a null in the Yes/No field

=Sum(Abs(Nz([Attachment Pre-test Completed Child1],0)+Nz([Attachment
Pre-test Completed Child2], 0)+Nz([Attachment Pre-test Completed
Child3],0)+Nz([Attachment Pre-test Completed Child4],0)+Nz([Attachment
Pre-test Completed Child5],0)+Nz([Attachment Pre-test Completed
Child6],0)+Nz([Attachment Pre-test Completed Child7],0)+Nz([Attachment
Pre-test Completed Child8],0))

Note: the Abs (Absolute) use to change negetive to positive, instead of *-1

--
Good Luck
BS"D


:

In database #1 report I use the following expression to count checked check
boxes and it works.

=Sum([Attachment Pre-test Completed Child1]+[Attachment Pre-test Completed
Child2]+[Attachment Pre-test Completed Child3]+[Attachment Pre-test Completed
Child4]+[Attachment Pre-test Completed Child5]+[Attachment Pre-test Completed
Child6]+[Attachment Pre-test Completed Child7]+[Attachment Pre-test Completed
Child8])*-1

When I exported this report to database #2 I get #Error in Print / Print
Preview? As always I'm stumped. Thanks in advance for any help.
 

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