Need help on report event
Hi,
My report has open event code that checks the month, and is supposed to print a particular budget amount in a certain report control (Text140). Problem is I get ‘expression has no value’ errors if my code looks like this:
If Month(Date) = 2 Then
DLookup("[febbudget]", "budgets", [RegionCode] = GlobalRegionCode) = Me.Text140
End If
And an ‘object required’ error if the above looks like this:
If Month(Date) = 2 Then
DLookup("[febbudget]", "budgets", GlobalRegionCode) = Me.Text140
End If
Since the regionCode value is blank in my 1st example, until the report is displayed, how can I assign it to GlobalRegionCode, which does have a value upon entry into the report? And if I delete regionCode completely as in the 2nd example, the Dlookup doesn’t know to use GlobalRegionCode against the regionCode field in “budgets” table when looking up the budget.
Please advise what event or programming procedure would be appropriate to fix my problem with my report.
Hi,
My report has open event code that checks the month, and is supposed to print a particular budget amount in a certain report control (Text140). Problem is I get ‘expression has no value’ errors if my code looks like this:
If Month(Date) = 2 Then
DLookup("[febbudget]", "budgets", [RegionCode] = GlobalRegionCode) = Me.Text140
End If
And an ‘object required’ error if the above looks like this:
If Month(Date) = 2 Then
DLookup("[febbudget]", "budgets", GlobalRegionCode) = Me.Text140
End If
Since the regionCode value is blank in my 1st example, until the report is displayed, how can I assign it to GlobalRegionCode, which does have a value upon entry into the report? And if I delete regionCode completely as in the 2nd example, the Dlookup doesn’t know to use GlobalRegionCode against the regionCode field in “budgets” table when looking up the budget.
Please advise what event or programming procedure would be appropriate to fix my problem with my report.