Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > General

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-18-2007, 09:15 AM
accesser2003 accesser2003 is offline
Registered User
 
Join Date: Jun 2007
Posts: 123
accesser2003 is on a distinguished road
How to programmatically align the control's position (Left,Top)

I want to progammatically align the report controls position.
I have a control with left=2.7 in the Design view property.
I want to set programmatically set this value to 3.0 or other value accoring to a parameters. The problem is that when I set this property at the event Report-Open, the control appears always in another position regardless of the left value, i.e appears always at the new constant position.

What is the problem you think?
Reply With Quote
Sponsored Links
  #2  
Old 08-18-2007, 10:23 AM
WayneRyan WayneRyan is offline
AWF VIP
 
Join Date: Nov 2002
Location: Camarillo, CA
Posts: 6,817
WayneRyan has a spectacular aura aboutWayneRyan has a spectacular aura aboutWayneRyan has a spectacular aura about
A,

The measurements are in "twips".

A twip is something like 1/1440 of an inch.

Experiment --> .Left = 1440 should move it one inch.

Wayne
Reply With Quote
  #3  
Old 08-18-2007, 11:06 AM
accesser2003 accesser2003 is offline
Registered User
 
Join Date: Jun 2007
Posts: 123
accesser2003 is on a distinguished road
Thanks for support,
Reply With Quote
  #4  
Old 08-18-2007, 11:12 AM
WayneRyan WayneRyan is offline
AWF VIP
 
Join Date: Nov 2002
Location: Camarillo, CA
Posts: 6,817
WayneRyan has a spectacular aura aboutWayneRyan has a spectacular aura aboutWayneRyan has a spectacular aura about
A,

Gload to help.

btw, why are you moving them? Are you resizing fields due to data length?

Wayne
Reply With Quote
  #5  
Old 08-18-2007, 06:09 PM
The_Doc_Man The_Doc_Man is offline
AWF VIP
 
Join Date: Feb 2001
Location: New Orleans, LA, USA
Posts: 7,190
The_Doc_Man is just really niceThe_Doc_Man is just really niceThe_Doc_Man is just really niceThe_Doc_Man is just really niceThe_Doc_Man is just really nice
I had occasion to do something like this once:

I had eight buttons, but never more than five would be active at any one time due to the nature of the functions on this rather complicated little form. So what I did is I found the first button and aligned it so its top was 1 twip plus the top plus the height of a line that I drew as a border for all control buttons. The left of this button aligned to the left of the border line.

Then the next active button I moved to the same top and to a left equal to 1 plus the left plus the width of the button to the left. I did this for as many buttons as were active and disabled all other buttons, which I aligned to a place that wasn't a control. And they were made not visible, too. Also not tab stops. While I was at it, I also identified the label controls and manipulated them, too.

As I clicked a button, part of the underlying code computed which buttons became "legal" in that context. I made the button placement code a subroutine that would traverse all buttons, placing the active ones and displacing the inactive ones. Obviously, activation and deactivation were external to the placement code. The buttons were separately activated based on a context subroutine that decided which buttons were legal at the time. So eventually this narrowed down to two subroutines called during each button-click event. It was a pretty slick little form if I do say so myself.
__________________
I'm a certified grandpa and proud of it.
Not quite so valuable after the MVP status expired.
Reply With Quote
  #6  
Old 08-19-2007, 08:15 AM
accesser2003 accesser2003 is offline
Registered User
 
Join Date: Jun 2007
Posts: 123
accesser2003 is on a distinguished road
Dear WayneRyan,

Thanks for your question. I use this because in a report I have five fields. I want to display these fields according to the user option. Before displaying the report, I show a form asking the user to check the control names, he want to see in the report.
Thus, if the user selcect only 2 controls out of 5 controls, then I distribure the report vertical space on 2. then align the report but moving these fields using the left properies.

I will be very happy if you can give me a way to do this without this long way. Is it possible at the report view to give the user the option to hide/show report fields?

Thanks
Reply With Quote
  #7  
Old 08-19-2007, 08:58 AM
WayneRyan WayneRyan is offline
AWF VIP
 
Join Date: Nov 2002
Location: Camarillo, CA
Posts: 6,817
WayneRyan has a spectacular aura aboutWayneRyan has a spectacular aura aboutWayneRyan has a spectacular aura about
Accessor,

There are no *easy* ways to do this. You can see by Doc's dissertation that
as your needs get more complex, the amount of code and effort increases
also. But, it can make things look really nice sometimes. Thanks for the input
Doc.

If you name your controls appropriately, you can save some work by looping
through them in your code, but you still have to implement the logic.

It is definitely "possible" to get user input after the report opens, but for
practical purposes your approach is the proper one.

Wayne
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Property cannot be set" error with Rich Text Box controls? prlaba Forms 0 10-24-2006 06:37 AM
auto style form controls - position and appearance antonyx Forms 0 10-04-2006 03:17 AM
Controls not displaying on form Mia Forms 0 03-11-2006 06:18 PM
Controls on subform disappear sard0nicpan Forms 1 03-31-2005 01:28 PM
Data in controls and same data in Datasheet view also. Subform not updating. !! HELP hallian92 Forms 0 05-08-2002 05:27 PM


All times are GMT -8. The time now is 10:01 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World