UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Error Using Function In Report Text Box, Office 2007    
 
   
dancingwwaves
post Mar 2 2012, 06:04 PM
Post #1

UtterAccess Addict
Posts: 139
From: USA



Greetings!

I have a text box in a report header. I want to display the result of a function, ecount by allen browne, in the text box. I have it working on several reports, but for some reason I'm getting various error messages in this one.

The arguments for ECount are:
CODE
Public Function ECount(Expr As String, Domain As String, Optional Criteria As String, Optional bCountDistinct As Boolean) As Variant


I'm trying to display the number of unique studentids in the query 'qrysrptEmplDuring_SSR'. I've tried the following two setups, but while they work perfectly in the
immediate window they generate the following errors when i try to use them in the textbox.

'invalid syntax: you may have entered a comma without a preceding value or identifier
=ECount("StudentID","qrysrptEmplDuring_SSR",,True)
i'm guessing the error is because of the back to back commas? so i tried it by just telling the code what bCountDistinct I wanted:

'error: you may have entered an operand without an operator
=ECount("StudentID","qrysrptEmplDuring_SSR",bcountdistinct:=True)

Grr. I've tried web searching, but so far with no luck. Any idea what is going wrong?

Thanks!
Go to the top of the page
 
+
 
Start new topic
Replies
pere_de_chipstic...
post Mar 4 2012, 02:13 AM
Post #2

UtterAccess VIP
Posts: 7,589
From: South coast, England



Hi Becca

Try:

=ECount("StudentID","qrysrptEmplDuring_SSR","",True)

hth
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 10:43 AM