Hi.
I am having an issue with using a DCOUNT expression in a query.
I am compiling an inventory, and trying to use a query to determine whether or not, a particular item has been used.
I have 2 tables for this example: tblDeliveryItems (the complete list of items)
and tblBHAItems (a table that has certain items from the tblDeliveryItems table used in an assembly).
My the tblDeliveryItems table has a format similar to this.
ID - Item - Details - etc
The tblBHAItems has a format similar to this:
ID - BHA - Item - etc
the [Item] field of the tblBHAitems, is linked to the tblDeliveryItems.ID field.
currently, the expression I am using in my query is:
IsUsed: DCount("*","tblBHAItems","tblBHAItems.[Item]=" & "[ID]")
This returns all zeros, and is therefor incorrect (there are entries in the tblBHAItems table).
if I change the expression to:
IsUsed: DCount("*","tblBHAItems","tblBHAItems.[Item]=" & "tblDeliveryItems.[ID]")
I generate an error (cannot find tbldeliveryitems.ID).
Can someone recommend a way of correcting this.
Thanks in advance,
Dan.
I am having an issue with using a DCOUNT expression in a query.
I am compiling an inventory, and trying to use a query to determine whether or not, a particular item has been used.
I have 2 tables for this example: tblDeliveryItems (the complete list of items)
and tblBHAItems (a table that has certain items from the tblDeliveryItems table used in an assembly).
My the tblDeliveryItems table has a format similar to this.
ID - Item - Details - etc
The tblBHAItems has a format similar to this:
ID - BHA - Item - etc
the [Item] field of the tblBHAitems, is linked to the tblDeliveryItems.ID field.
currently, the expression I am using in my query is:
IsUsed: DCount("*","tblBHAItems","tblBHAItems.[Item]=" & "[ID]")
This returns all zeros, and is therefor incorrect (there are entries in the tblBHAItems table).
if I change the expression to:
IsUsed: DCount("*","tblBHAItems","tblBHAItems.[Item]=" & "tblDeliveryItems.[ID]")
I generate an error (cannot find tbldeliveryitems.ID).
Can someone recommend a way of correcting this.
Thanks in advance,
Dan.