I'm using a form to run a 2 parameters query on pharmacy data
The query is setup like this:
BrandName Generic Name Strength Quantity
[Forms]![F Drug Used within Dates]![BrandName] on the brand name(combobox) field
and
Between [Forms]![F Drug Used within Dates]![StartDate] And [Forms]![F Drug Used within Dates]![EndDate] on the date field
This is passed to a report which sums the quantity of drugs used between the two dates.
This works great until a drug from druglist does not contain data between the dates I get an error (#error) in the report for SumofQuantity field reflecting this.
I tried using iif(isnull([brand name]),"unknown",format([brand name],"@;""ZLS""")) Which returns everything that is not null which of course is incorrect. I'm looking to return a 0 in the Sum of Quantity field on the report if the date range on the brand name does not produce data. What can I do to replace that report error with a 0? I would appreciate any advice Thank you in advance.
The query is setup like this:
BrandName Generic Name Strength Quantity
[Forms]![F Drug Used within Dates]![BrandName] on the brand name(combobox) field
and
Between [Forms]![F Drug Used within Dates]![StartDate] And [Forms]![F Drug Used within Dates]![EndDate] on the date field
This is passed to a report which sums the quantity of drugs used between the two dates.
This works great until a drug from druglist does not contain data between the dates I get an error (#error) in the report for SumofQuantity field reflecting this.
I tried using iif(isnull([brand name]),"unknown",format([brand name],"@;""ZLS""")) Which returns everything that is not null which of course is incorrect. I'm looking to return a 0 in the Sum of Quantity field on the report if the date range on the brand name does not produce data. What can I do to replace that report error with a 0? I would appreciate any advice Thank you in advance.