A couple of quickies...

Essendon

Registered User.
Local time
Today, 20:00
Joined
Oct 25, 2001
Messages
65
Hi all,

Sorry to hassle you all with so many questions! Here is a couple more...

1) I was wondering if there is code that you can put behind a button so that when it is clicked on, it goes to a report preview and forces landscape orientation....

I currently have:
DoCmd.OpenReport stDocName, acPreview

And even though I have set the report as landscape, occassionaly it starts up in portrait!

2) I was also wondering what the best way to detect a report being empty (because it uses a query that returns no results) is? I would rather bring up a msgbox than have an empty report with errors on it...

Thanks..

Peter
 
I assume you are using Access 2000.
This problem of loosing printer settings has been asked many times.

It is a problem with the original release of Office/Access 2000 caused by the Autocorrect feature in Access. Follow the link below for more information on this and a "Fix" for the problem.


http://support.microsoft.com/support/kb/articles/Q240/8/26.ASP

As for your second question, you need to use the On No Data event of the report to give the message of "No Records Returned"

I sometime use the On Active event of the report to do this. Here is an examlpe.

Private Sub Report_Activate()
On Error Resume Next
Dim strMsg As String, strTitle As String
strMsg = "There Were No Records Returned for the Criteria Entered!" & vbCrLf & _
"Check Your Entry and try again."
strTitle = " No Records Returned!"

If Not Me.Report.HasData Then
  DoCmd.Close acReport, Me.Name
  MsgBox strMsg, vbExclamation + vbOKOnly, strTitle
End If
End Sub

HTH
RDH

[This message has been edited by R. Hicks (edited 10-27-2001).]
 
I am developing the database in Access 2000, but the final version will be running on Access 97. Does this mean that landscape problem will not exist once I have converted it to 97?

Thanks for your response...
 
You should not have this problem in Access 97 .....

But I hope you haven't made a mistake by developing your application in Access 2000. You can run into all kinds of problems converting your app backwards. Especially if you use any references to ADO. I would never have attempted doing it that way.

Good Luck,
RDH

[This message has been edited by R. Hicks (edited 10-27-2001).]
 
I found out after I had started that they had Access 97. I thought that they would be purchasing Access 2000...

I dont suppose you can package it all together to make an exe file that runs independent of access?!
 

Users who are viewing this thread

Back
Top Bottom