no data

dott

Registered User.
Local time
Today, 22:50
Joined
Jun 24, 2003
Messages
56
I have a report which when used on an empty data set gives me this error:
'You entered an expression that has no value.'

It is trying to evaluate:
If Me.Wdate < Date Or Me.Idate < Date Or Me.Ndate < Date Then

So i assume access is stupid enough to error because there is no data instead of skipping the if block

but anyway, is there a way around this?
 
Why do you want to run a report with an empty dataset??
 
i dont, thats the point

i want it to either skip the code so it doesnt error, or just not run at all
 
If you do not want the report to open if the dataset is empty, set the On No Data event to

Cancel = True

In the VBA window
 
Thanks fizzio that works except for the following inane error:
'The OpenReport action was caceled.'

Anyway around this? I dont see why access would error on this considering its what the code tells it to do.

thanks
 
Yes, it's not an intuitive set up is it? What I do is make sure I have an error handler on the report's on open event and I capture that 'The OpenReport action was cancelled' error and just have the event perform an exit sub if that error number comes up.
 

Users who are viewing this thread

Back
Top Bottom