Counting Error

ddrew

seasoned user
Local time
Today, 22:18
Joined
Jan 26, 2003
Messages
911
I have an unbound text box that gets its value from counting the amount of records on a seperate form:

Code:
=Forms!FaultCount_frm!CountOfDateReported

When the count is less than 1 i.e 0 I get the #Error message in the text box, can somebody please tell me how to fix this problem?
 
Here's a stab in the dark:

=nz(Forms!FaultCount_frm!CountOfDateReported)

???
 
Code:
=nz(Forms!FaultCount_frm!CountOfDateReported)

Didnt work I'm afraid Ken!
 
I'm a bit confused - How are you populating:

Forms!FaultCount_frm!CountOfDateReported

Is CountOfDateReported a field in the forms underlying query?
 
Code:
Forms!FaultCount_frm!CountOfDateReported
It's a querry thats looking at a different form and counts how many records there are.

I just know your gonna tell me thats not the right way to do it and that theres a better way, trouble is I dont know it;)
 
Sorry to be bouncing in and out - couple of fires here at my real job :)

Have you though about a dcount()

Any chance you can post enough of the db to look at?
 
=nz(Forms!FaultCount_frm!CountOfDateReported)

I think Ken was too fast with the fingers, ;]

Should be ...

Code:
=NZ(Forms!FaultCount_frm!CountOfDateReported,0)

The ",0" bit is the alternative if it is Null.

-dK
 
I thought the default of zero was implied if left out?
 
Hehehe .. I ran off to test.

When I was typing in the editor, the little helper thing that pops up implied an argument, but did not give me an error when I left it out (so I would assume optional, too.)

I left it out and it did not place the 0 in the unbound control. Again, tested in '07 on a '02 DB. Who knows?

-dK
 
hehe ... take her to task on it, I dare ya.

-dK
 
Still not working Ken, its clearly something im doing wrong/have done wrong. Its to big to post any chance I could PM it to you? Thanks
 

Users who are viewing this thread

Back
Top Bottom