Count Records on Subform

aqif

Registered User.
Local time
Today, 10:01
Joined
Jul 9, 2001
Messages
158
Hi
smile.gif


I am using a continous subform and on that form footer I placed a text box and set its control source as
=Count([PtID]) & " Records"
When the form contains some records it gives proper number of records but when form doesnot have any records it returns nothing instead of returning zero. I have also tried
=IIf(Count([PtID])>0,Count([PtID]),0) & " Record(s) "
or =Nz(Count([PtID]),0) & " Records"
or =IIf(IsError(Count([PtID]))=False,Count([PtID]) & " Records","0 Records")
any suggestions?

Cheers!
Aqif
 
Sorry, but I don't know if my suggestion will work either.
But, you can try to add this to one of the SUB functions of your textbox (here its in the OnCurrent Event of the form, not the textbox):

Private Sub Form_Current()
If IsNull(Count([PtID]) & " Records") Then
Me!NameOfTextBox="0"
EndIf
End Sub

I do appologize in advance if this doesn't work!

CompG

[This message has been edited by CompG (edited 08-17-2001).]
 
Nope .....it didn't worked
frown.gif
I was trying to accomplish that by using a Control source expression but i think i have to adopt some coding approach behind some event to make it go......thanxxx for ur help
smile.gif


Cheers!
Aqif
 
Try:

=Count(*)

I've tried to get my textbox to return nothing when there are no records but can;t get it to do it. It returns me a visible zero(0) regardless.

Ian
 

Users who are viewing this thread

Back
Top Bottom