Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving Objects on Reports 1

Status
Not open for further replies.

PGM2

Technical User
Mar 10, 2004
30
US
Hello, I would like to know if I move some textboxes on report, if no data exists, is there any way to move them back to the orginal spots of design other than reassigning the value of position? I am able to hide and then move the controls up but I am wondering if theres a built in function that will make all objects visible and place them in their orinal position. Creating one textbox (= etc.) for all desired fields/objects is not an option. Thanks! Oh and any advice would be helpful.[bugeyed]
 
You can store the original position in the Tag property so it is available for moving the control to the original position.
Code:
'store the original top position in the On Open of the report
'you can then use the tag property to reposition the control
Dim ctl as Control
For each Ctl in Me.Controls
   If ctl.Tag & "" = "" then
      ctl.Tag = ctl.Top
   End If
Next

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I have never used the tag property. How would I go about storing the original positions? A little lost...I believe I read that you can store information in Tags and they will not affect anything unless you call upon their stored contents. Why not use a variable........I have a few boxes top positions...sorry just a beginner.
 
The code that I provided could be placed in the On Open Event of the report and would store the original top property of every control. If you want to move the control back to the original position, you would use:
Code:
Me.txtMyTextBox.Top = Val(Me.txtMyTextBox.Tag)

YOu could also use code that stores the top property of just a few controls in the tag properties.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thanks so much dhookom this did fix my issue and the controls moved accordingly. Can you tell me what type of information control types are designed to store? Also since the controls are being moved how can I push up the bottom of the detail section to be snug up to the last odject. I did changed the "allow shrink to yes" of detail section properties???...maybe I am being to detailed...Feel free not to respond as your help has been so helpful and I can do the research on control type myself if you are busy. Again thanks [2thumbsup]
 
I don't know how/if you can push up the bottom of the detail section. Not sure what you mean by the types of information...? Controls have lots of properties.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top