Damocles25
New member
- Local time
- Yesterday, 21:32
- Joined
- Aug 14, 2021
- Messages
- 2
Hello Guys,
Need an assist on the syntax for Dcount. I have a table "Tbl_UnitManufacturingRecord" which controls how a part moves and is classified. the two criteria that I am trying to use to count are "IsPmr" (CheckBox yes/no) and "WorkOrderNumber" which is a long integer. The table has multiple records under a given WorkOrder (think batch run with individual Sn as key field) and the PMR is a "Scrap Designation".
I have a form that I want to have populate a field with the current count of PMR (scrap assemblies) for the Forms current Work Order.
The form is "Frm_ActiveWorkOrderStatus" and the call fields are "WorkOrderNumber" and "Chb_IsPmr". Respectively one will pull the WorkOrderNumber value, and the Other will pull the Static "true" value present in the form
Taking baby steps I was able to get a total PMR count from the table when set to true, but this returns all PMR's regardless of Work Order.
Dim VarCount As Integer
VarCount= DCount("[IsPMR]", "Tbl_UnitManufacturingRecord", "[IsPMR] = true")
I researched the syntax but keep getting different errors when I try different suggestions to add the WorkOrderNumber criteria.
for example
'VarCount = DCount("[IsPMR]", "Tbl_UnitManufacturingRecord", "[IsPMR] = true" And [WorkOrderNumber] = " & Forms![Frm_ActiveWorkOrderStatus]![WorkOrderNumber] & ")
Any Help you could give would be greatly appreciated. I just can't seem to hit the right mix.
Sincerely
LP
Need an assist on the syntax for Dcount. I have a table "Tbl_UnitManufacturingRecord" which controls how a part moves and is classified. the two criteria that I am trying to use to count are "IsPmr" (CheckBox yes/no) and "WorkOrderNumber" which is a long integer. The table has multiple records under a given WorkOrder (think batch run with individual Sn as key field) and the PMR is a "Scrap Designation".
I have a form that I want to have populate a field with the current count of PMR (scrap assemblies) for the Forms current Work Order.
The form is "Frm_ActiveWorkOrderStatus" and the call fields are "WorkOrderNumber" and "Chb_IsPmr". Respectively one will pull the WorkOrderNumber value, and the Other will pull the Static "true" value present in the form
Taking baby steps I was able to get a total PMR count from the table when set to true, but this returns all PMR's regardless of Work Order.
Dim VarCount As Integer
VarCount= DCount("[IsPMR]", "Tbl_UnitManufacturingRecord", "[IsPMR] = true")
I researched the syntax but keep getting different errors when I try different suggestions to add the WorkOrderNumber criteria.
for example
'VarCount = DCount("[IsPMR]", "Tbl_UnitManufacturingRecord", "[IsPMR] = true" And [WorkOrderNumber] = " & Forms![Frm_ActiveWorkOrderStatus]![WorkOrderNumber] & ")
Any Help you could give would be greatly appreciated. I just can't seem to hit the right mix.
Sincerely
LP