Questions tagged [dcount]
49 questions
4
votes
1 answer
Access: Update query with count in subquery - error or all results
I know that you should not store calculated values in a database but in this case the structure is given and I have to deal with that.
I have two tables:
Table1 with the fields (i.e. customer, product, price, count)
Table2 with the fields (i.e.…

Thorsten
- 43
- 1
- 4
2
votes
0 answers
DCount using a Dim reference in Access VBA
Really struggling to get my reference to register in the search? I'm trying to create a check to see if the record is already in my table?
Private Sub Command10_Click()
Me.UniqCONCAT = (Me.CQRWeekNumber) & (Me.UserNametxt) & (Me.CQRSite)
Dim…

Ellis Ellis
- 33
- 4
2
votes
1 answer
Prevent Duplicate Entries VBA
First off I am a bit of a novice when its comes to VBA, so everything I do is a bit of hit and miss but normally I eventually figure out the problem.
However this time I have been stuck for days and can't seem to find the issue!
I have the following…

CLS
- 21
- 2
2
votes
2 answers
MS Access: unbound text box for dcount with date parameters
I have 2 tables in a 1-many relationship:
Person - Application
Every time a person meets criteria, a new record is created in Application, and today’s date is added to field App_OutAwardDate.
I want to add something like an unbound text box to the…

Red
- 21
- 2
2
votes
2 answers
Control Source property: Dcount: Unable to specify Multiple Condition
I have two commands in Microsoft Access 2010 that works fine individually:
=DCount("*","Order","DATE = #" & [Forms]![formOrder]![DATE] & "#")
=DCount("*","Order", "STATUS = 'ST." & [Forms]![formOrder]![StatusType] & "'")
However, when combining…

Arjun
- 25
- 4
1
vote
1 answer
DCount using two Criteria
I have an Access Form with two combo boxes, PO Number and Vendor Number. The Vendor Number will automatically filter to show only those who match the chosen PO Number (PO Numbers are sadly not unique; multiple unrelated vendors may have 2180965 as…

Newbie
- 55
- 5
1
vote
1 answer
Access Query: Unable to get correct Count
I have a table named [Mailbox Status] listing all email mailboxes that are to be migrated to O365. Mailboxes are migrated in batches (column BatchNumber) and when they are migrated, the column MailboxState is set to 'Client Migrated'.
For each…

Tom Zvolensky
- 63
- 7
1
vote
1 answer
How to work out the Average of DCounts
I have recently created a report that shows the number of rows from my table for different yes/no attributes. Now, I would like to add another box that will show the average of these two look ups, as well as the difference between the results as…

Matt H
- 147
- 1
- 13
1
vote
1 answer
DCount not finding matching records in Access
I am not getting the correct value for DCount
Table is "Lessons":
ID (auto) pk
InstructorID As Integer
Weekof As Date
StudentID As Integer
Status As Byte
My function is
Public Function NoRecordsFound(ByVal instructorid As…

user2978241
- 311
- 1
- 5
- 9
1
vote
1 answer
Using VBA in Access how do I use Dcount to count the number of record that contain this formula - DatePart("y", Now)?
I want to go through the records in a table to see how many already contain the Julian date of today. I want it to be a wildcard search because my project numbers will be in this format "16-2101". The Julian date is in the middle (210).
My code…

Mekenzie Buhr
- 29
- 1
- 8
1
vote
1 answer
How to remove duplicates from form recordsource in Access
I'm building a rather complex database for my limited (yet slowly growing) knowledge of database and programming. So, I really appreciate your help.
The database keeps track of customers, buildings, rooms, and equipment which is in rooms.
I have a…

Shawn Gadwa
- 11
- 2
1
vote
1 answer
DCount function in access without specific condition
I am trying to get an Access report to identify if a text field (NH) does not match with the same ID. For example, ID 179 has two rows but each NH is different (12345 & 12346). I am trying to use DCount to count the IDs where the NH does not match…

Reuben Ellis
- 15
- 1
- 7
1
vote
1 answer
#ERROR on =IIf(DCount [...] with Alphanumeric field
I am using a DCOUNT function to look at a table in access and see if a record exists - if it does then return a yes value.
=IIf(DCount("*","COMMENTS","[PROJECTID] = " & [PROJECTID])>0,"YES","")
This works great if my ProjectID is all numeric values…

Ethan V
- 51
- 1
- 5
1
vote
1 answer
IF statement using Dcount
Access complains "Data Type Mismatch in criteria expression" with this code ...
If DCount("[Serial Number]", "INVENTORY OVERVIEW", "[Serial Number] =" & Val(txtSERIAL)) > 1 Then
Serial Number is the field I'm trying to count.
INVENTORY OVERVIEW is…

Adam Bowsey
- 11
- 2
1
vote
2 answers
DCOUNT function doesn't return the correct result
I tried hard but couldn't found out why the formula in cell S10 below returns value 0 instead of 1, could you explain?

alwbtc
- 28,057
- 62
- 134
- 188