Set report orientation at run time

Alexandre

Registered User.
Local time
Today, 21:17
Joined
Feb 22, 2001
Messages
794
I ve just written a function to set reports margins at run time, to put an end to that bad habit that Access has to 'forget' the page settings from time to time. What I could not find was a method/property to set set the page orientation (portrait / landscape).
Does anybody know how to ? Thanks in adavance.

Alex
 
Not off hand. But, I do know how to get by the bug that causes report setup info to be lost.

Tools/Options/General tab
uncheck Track Name AutoCorrect Info
 
Thank you Pat, but I am REALLY not willing to desactivate the nameAutocorrect. Although not perfect I find it a much to valuable feature till one is sure not to change the DB design anymore . That is why I took the pain to write a function setting reports margins at run-time.

Any idea is still welcome!

Alex
 
OK, then, just set off Name Autocorrect for the users:
Sub CheckACSettings()
Const conText = 0
On Error GoTo CheckACSettingsErr
' Constant represents Text setting of Default
' Field Type option.

Dim strMsg As String

' Determine current settings
varTrackSetting = Application.GetOption(strTrackAC)

'Debug.Print varTrackSetting

strMsg = "Turn off Name Autocorrect?"
If varTrackSetting <> conText Then
' Prompt user to change setting if it's not False.
If MsgBox(strMsg, vbYesNo) = vbYes Then
' Change setting to Text.
Application.SetOption strTrackAC, False
End If
End If

Exit Sub

CheckACSettingsErr:
MsgBox Err.Description

End Sub

' Call this when the user exits the db
Sub RestoreACSettings()
On Error GoTo RestoreACSettingsErr
' Debug.Print varTrackSetting
Application.SetOption strTrackAC, varTrackSetting
Exit Sub

RestoreACSettingsErr:
MsgBox Err.Description

End Sub
 
Thank you both for your help.

Chris RR.
I like very much the method and can already think about a couple of things I ll try to adapt it to.

But at the moment...
redface.gif
Shame on me
redface.gif

I just found the property ... in Access help. Not my fault, it seems that the help file on my computrer is damaged/not well installed. I found the info immediatly when I had a look to the help on another desktop.

BTW, for any who might be interested the property is PrtDevMode and it comes with sample code in the Access help file.

Alex-the-ashamed
 

Users who are viewing this thread

Back
Top Bottom