Help with "Left" property

  • Thread starter Thread starter Shadow
  • Start date Start date
S

Shadow

I have 2 questions and would be appreciated if somebody put me on the right
path.
I have to change the position of a textbox in a report for different
situations.


1-
The reports opens with a click on a button in a form:
DoCmd.OpenReport "rpt", acViewPreview
Reports!rpt.left=1250

The report opens, but the position of the textbox doesn't change.


2-
I've tried to change the position of the textbox in the report's open event:

Private Sub Report_Open(Cancel As Integer)
if Me.OpenArgs="EM" then UserID.Left = 1250
End Sub

In this case the left position of the textbox changes to 1250. but when I
close the report and check the property of the textbox in design view, the
left property shows as 1650.

any kind of help is much appreciated.
 
1. You are trying to change the left (margin?) of the
Report, not the TextBox in the first code.

2. You change the Left position of the TextBox in the
current view of the Report but the *design* of the Report
remains the same as the saved version of the Report design.

HTH
Van T. Dinh
MVP (Access)
 
thanks for your reply.

1- Sorry, I was in a hurry and hadn't typed the code as I had used.
Actually, I'm useing
Reports!rpt!UserID.left=1250
and it doesn't work.

2- Isn't there a way to change the position of a textbox in a report with
VBA and save it?


thanks a million
 
1. I *think* once the Report processing has been completed, i.e. the Report
appears on screen (or being printed), you cannnot change the position of the
Texboxes. After all, Reports are supposed to be static and how would you
change a *printed* page?

2. You have to open the Report in DesignView (by code if you want). OTOH,
why not simply change it using the GUI?
 
thanks for your advices and help.



MnInShdw


Van T. Dinh said:
1. I *think* once the Report processing has been completed, i.e. the Report
appears on screen (or being printed), you cannnot change the position of the
Texboxes. After all, Reports are supposed to be static and how would you
change a *printed* page?

2. You have to open the Report in DesignView (by code if you want). OTOH,
why not simply change it using the GUI?
 
Back
Top