Hi
Your code:
Code:
If Val(rsDrugInfo!Chemical_Name) = Val(rsChemicalList(Number).Name) Then
rsDrugInfo!Curr_Quantity = Val(rsDrugInfo!Curr_Quantity) - Val(rsChemicalList!Fields(Number))
end if
I think the problem here is that you are trying to reference a value in rsChemicalList were in actual fact it is a field name. I have not tried any alternative syntax but I think it should go something like this:
Code:
If Val(rsDrugInfo!Chemical_Name) = rsChemicalList.Fields(Number).Name Then
rsDrugInfo!Curr_Quantity = Val(rsDrugInfo!Curr_Quantity) - Val(rsChemicalList!Fields(Number))
end if
Hope this helps
|
__________________
As we sit bousin' at the nappy,
an' gettin fou, o unco happy
|