Getting DCount() to work correctly

A

Apex_RTX

The databse is for tracking educational expenses at a medical practice
each emplyee is given a budget.
I have a form that contains employee demographic data inlcuding their budget
and remainder value. It contains a sub form with a list of Educational
expenses-- where, why, how pay, etc.

the remainder is a calculated field based on the total of expenses
pertaining to the emplyee on the main form. If there are no events for that
employee yet, I want the sub form to be blank. If there are no events then
the remainder value kicks up an error because it's trying to calculate a
value based on null data. I simply want to count the occurances of a specific
employee's events and place that calue in a text box using a a DCount()
function for the field's control sourse. I get an error in the field when the
form loads: #Name?

Here's the syntax of the control cource:

=DCount("EmpIDNo","tblCME_Data","Criteria =" & [gblEventCount])

I simply want the value of the global variable bdlEventcount to appear in
the text box, or at least the value of the field, txtEmployeeID_No which is
the field where gblEventcount gets its value.

Would someone be able to guide me towards the correct syntax?
 
K

Ken Snell \(MVP\)

Bobby said:
I think if you put that systax in text box you should use ";" instead of
","


That depends upon your Regional Settings and which language version of
ACCESS you're using.
 

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

Similar Threads

Count number of records by date 2
Using a form to supply DCount Criteria 21
DCount 4
DCount with multiple criteria 1
DCount 2
dcount syntax help 6
DCount syntax 6
Dcount Problem 3

Top