Alexandre
09-10-2001, 02:53 AM
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
Pat Hartman
09-12-2001, 07:33 PM
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
Alexandre
09-12-2001, 09:13 PM
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
Chris RR
09-13-2001, 08:02 AM
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
Alexandre
09-13-2001, 09:38 AM
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... http://www.access-programmers.co.uk/ubb/redface.gif Shame on me http://www.access-programmers.co.uk/ubb/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