Skip to content
Advertisement

DCount vs. SQL SELECT COUNT(*)?

I am trying to get a count of all items sent to a supplier based on the purchase order they are assigned to. But I can’t seem to get the control to show a number of items based on the purchase order instance – it keeps throwing either a #name? or #error! message in the text box when the form is activated.

Create statement for tblPODetail

Create statement for tblPOGaugeDetail

Query statement for purchase order details that I want the counts to appear in

I’ve been a bit frustrated as I’ve read a bit on both DCount() and SELECT COUNT(*), but can’t seem to get -either- of them to work. Any help would be greatly appreciated! Thanks in advance!

— Edited 06/18/2009 @ 1542 hours —

This is an example of the SELECT COUNT I tried to use in code when the subform’s On Current event triggered:

This is an example of the =DCOUNT statement as attached to the control in the subform.

Neither of these worked – sadly.

Advertisement

Answer

Does your query work without the count(*)?

Use an actual field name for the first arguement of DCount Get the control name out of the where string.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement