Oooops, actually, not quite. If the report does have data, then it just
cancels the print preview.
I have tried adding an ElseIf to make it work but no luck.
Any suggestions?
> Brilliant, thanks very much.
>
[quoted text clipped - 39 lines]
>>> Thanks
>>> CJ
Can you post the code?

Signature
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
> Oooops, actually, not quite. If the report does have data, then it just
> cancels the print preview.
[quoted text clipped - 45 lines]
> >>> Thanks
> >>> CJ
The If has to be there, so I don't understand how did you remove the End If
If there is no if, the report will be always close

Signature
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
> Oooops, actually, not quite. If the report does have data, then it just
> cancels the print preview.
[quoted text clipped - 45 lines]
> >>> Thanks
> >>> CJ
CJ - 30 Oct 2005 17:49 GMT
Hi, sorry for the delay.
I solved it with the following code:
If Me!rsubPumpsInStock.Report.HasData = False Then
DoCmd.Close
MsgBox "No Pumps In Stock. Report Preview Cancelled",
vbInformation
Else
DoCmd.Maximize
End If
I just changed the order of the events, making sure that the report closed
first. I'm not sure what happened with the End If thing, I don't remember
anymore.
Thanks for all of your help.
> The If has to be there, so I don't understand how did you remove the End
> If
[quoted text clipped - 51 lines]
>> >>> Thanks
>> >>> CJ
Ofer - 30 Oct 2005 23:41 GMT
I'm happy you got it sorted out.
Good luck with your project

Signature
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.
Good luck
> Hi, sorry for the delay.
>
[quoted text clipped - 69 lines]
> >> >>> Thanks
> >> >>> CJ