Hi all,
Using access 2K
This I assume is a fairly simple one (except for me that is).
My report that I run, ocassionally resets the page setup values that I have assigned it through page setup. I thought that a good way to fix this would be to assign the page setup values through code as part of the report_Open sub.
The problem I'm having is that when I add the line "Me.Report.Orientation = 1" and attempt to run the report. I get a runtime error advising that I can't assign a value to the object (2448). Here is my code:
Private Sub Report_Open(Cancel As Integer)
Report.Orientation = 1
End Sub
Maybe my thinking is wrong, but I assumed that 1 = landscape, and 0 = portrait. Because I stepped through the code and use the intermediate window to get the value of Report.Orientation, and got "Report.Orientation = 0" (I set the report to portrait through page setup on purpose to make sure that my code works). Maybe I'm using the wrong piece of code here for what I want to achieve?
Just to take this further, how would I set the margins to the following through code:
Top = 20mm
Bottom = 20mm
Left = 20mm
Right = 20mm
Thanks in advance,
Tadynn
Using access 2K
This I assume is a fairly simple one (except for me that is).
My report that I run, ocassionally resets the page setup values that I have assigned it through page setup. I thought that a good way to fix this would be to assign the page setup values through code as part of the report_Open sub.
The problem I'm having is that when I add the line "Me.Report.Orientation = 1" and attempt to run the report. I get a runtime error advising that I can't assign a value to the object (2448). Here is my code:
Private Sub Report_Open(Cancel As Integer)
Report.Orientation = 1
End Sub
Maybe my thinking is wrong, but I assumed that 1 = landscape, and 0 = portrait. Because I stepped through the code and use the intermediate window to get the value of Report.Orientation, and got "Report.Orientation = 0" (I set the report to portrait through page setup on purpose to make sure that my code works). Maybe I'm using the wrong piece of code here for what I want to achieve?
Just to take this further, how would I set the margins to the following through code:
Top = 20mm
Bottom = 20mm
Left = 20mm
Right = 20mm
Thanks in advance,
Tadynn