DCount??

  • Thread starter Thread starter GD
  • Start date Start date
G

GD

Would I use DCount to find out how many times a particular PO# is in a field?
If so, what would the syntax look like?

Query: Q46_IrregularCode4POs

PONo What I need
C2543-00 1
E1432-4500048172 2
E1432-4500048172 2
E1432-4500053081 2
E1432-4500053081 2
E1432-4500054353 2
E1432-4500054353 2
E1432-5000008528 2
E1432-5000008528 2
E1437-4500044066 2
E1437-4500044066 2
etc...
 
Thanks, NG. But that solution didn't work, because I need to be able to edit
the table from this query, and using your solution locks it.

Is there no expression that can get me the results I need?
 
HI,

in this case you can try using a DCount function, but I'm afraid this will
be rather slow. The syntax would be something like:

fldMyCount = Dcount("ID_Field","TableName","[Name_PONrField_In table] = " &
[PONr])
 
you're showing us what you want to see, but not what you have. not knowing
what the query is or what it does, i can only suggest that you use a Totals
query. either turn your current query into a Totals query, or use the
current query as the base for a Totals query.

hth
 
Why? What will having the ability to edit the table allow you to do? (less
about the "how", more about the underlying business need this satisfies...)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Then you probably need something like the SQL generated by the Find Duplicates
query wizard.

SELECT *
FROM [SomeTableOrQuery]
WHERE [PoNo] In
(SELECT PoNo
FROM [SomeTableOrQuery]
GROUP BY PoNo
HAVING COUNT(*) > 1)
ORDER BY PoNo

If you have to show the single PONo records then you are kind of stuck using
the much slower option of DCount function.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top