A
Alberta Rose
Good morning. I have a database that I've taken over and have a problem with
an existing reports' VBA code. In this code, I need to know if I can add
instructions so that if there is not a matching value, a zero is populated on
my report. Otherwise the report subtotals do not show up. This is part of
the code:
'Assign the variable "ab" to txtCraftLabEst"
Dim ab As Variant
ab = DLookup("[EstimatedHours]", "qryCraftLabHrs", "[ContractNumber]=
[Forms]![frmViewCloseout]![cmboContractNumber]")
Me.txtCraftLabEst = ab
If there is no value in the table for this CraftLabEst, I want a zero
populated on my report. We are constantly having cost code/cost type changes
and additions, and at times I have to change the report to include new cost
code/cost types. The new records in the table will include this field, but
the old records do not, so when I run my report, the older ones that don't
have that cost code/cost type combos, do not show up but then my subtotals do
not appear. I've tested adding the missing lines in the table and then the
subtotals and total appear when I run the closeout report.
Thanks....Laurie
an existing reports' VBA code. In this code, I need to know if I can add
instructions so that if there is not a matching value, a zero is populated on
my report. Otherwise the report subtotals do not show up. This is part of
the code:
'Assign the variable "ab" to txtCraftLabEst"
Dim ab As Variant
ab = DLookup("[EstimatedHours]", "qryCraftLabHrs", "[ContractNumber]=
[Forms]![frmViewCloseout]![cmboContractNumber]")
Me.txtCraftLabEst = ab
If there is no value in the table for this CraftLabEst, I want a zero
populated on my report. We are constantly having cost code/cost type changes
and additions, and at times I have to change the report to include new cost
code/cost types. The new records in the table will include this field, but
the old records do not, so when I run my report, the older ones that don't
have that cost code/cost type combos, do not show up but then my subtotals do
not appear. I've tested adding the missing lines in the table and then the
subtotals and total appear when I run the closeout report.
Thanks....Laurie