?
Solved

DCount not working?

Posted on 2011-03-03
5
Medium Priority
?
508 Views
Last Modified: 2013-11-27
Greetings,

i'm filtering a recordset, then counting how many records meet the criteria. I know the filter is working right but DCount is not working right. I'm sure that I'm overlooking something so could someone help me out. Thanks!
.Filter = "[RecID] = Null"
i = DCount("*", "qry_ProcFormS02_Combobox_Values", "[RecID] = Null")

Open in new window

0
Comment
Question by:Anthony Berenguel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 100 total points
ID: 35030162
Try these perhaps:

= DCount("*", "qry_ProcFormS02_Combobox_Values", "[RecID] Is Null")

= DCount("*", "qry_ProcFormS02_Combobox_Values", "IsNull([RecID]")
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35030172
sorry:
or:
= DCount("*", "qry_ProcFormS02_Combobox_Values", "IsNull([RecID])")
0
 
LVL 10

Author Comment

by:Anthony Berenguel
ID: 35030210
Thanks, boaq2000. I also just  figured out that i = DCount("*", "qry_ProcFormS02_Combobox_Values", "[RecID] is null") works as well.

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35030488
OK

But try to us the caps, this is how that Autocorrect will convert it to in many cases
0
 
LVL 10

Author Comment

by:Anthony Berenguel
ID: 35030496
will do. Thanks! And special thanks for the quick help!
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question