Results 1 to 9 of 9
  1. #1
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    Align controls next to each other

    This has been driving me nuts for some time.


    I have forms that have a row of text and combo boxes.
    I work in a Windows region that uses cm for the grid, with 5 for Grid x and Grid Y

    I want to perfectly align the right edge of one control to the left edge of the adjacent control using the arrow keys.
    If I use left arrow, it moves the control too far to the left making it appear as an extra think border line between the controls, or a space/overlap.
    Is there key combination that allows for finer control movement than just left arrow?
    Or maybe an align feature that puts the controls right next to each other?

    Thanks

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Yes, simple - select all the controls you want to align, right click the edge of one of the controls .
    Select the Align option in the right click menu.
    Select Right, left top or bottom depending on where you want them to go.

    Edit: If it's moving in big chunks press the ctrl key with the arrow keys to get a more granular movement, and/or turn off align to grid.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    The align right seemed to align them,
    but it moved all the controls to the right.
    I select them all again, and try to move all of them to the left, but they won't move left.
    What am I not getting?

    Update: Never mind, I figured out a label was banging against the left of the form
    Not fun on a small laptop

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    There are occasions when a zoom function would be handy in design mode, but there are a 100 other things to improve in Access before that should hit the update list...
    Quote Originally Posted by twgonder View Post
    Not fun on a small laptop
    Time for a second monitor???
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    Join Date
    Apr 2017
    Posts
    1,680
    When you select a row of controls, and then set the align option for selection top or bottom, all controls in selection are aligned to top or bottom.
    When you select a column of controls, and then set the align option for selection left or right, all controls in selection are aligned to left or right.

    When you select e.g. a row of controls, and then set the align option for selection left or right, all controls in selection are aligned to left or right, and will be overlaying - i.e. most of them will be only partially visible.

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Quote Originally Posted by ArviLaanemets View Post
    When you select a row of controls, and then set the align option for selection top or bottom, all controls in selection are aligned to top or bottom.
    When you select a column of controls, and then set the align option for selection left or right, all controls in selection are aligned to left or right.

    When you select e.g. a row of controls, and then set the align option for selection left or right, all controls in selection are aligned to left or right, and will be overlaying - i.e. most of them will be only partially visible.
    That last statement isn't true, unless the controls are already overlapping.
    I have a simple gif file demonstrating it but the stupid forum software keeps renaming to a jpg, so it won't display properly.
    Attached Thumbnails Attached Thumbnails Left Align1.jpg  
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    Join Date
    Apr 2017
    Posts
    1,680
    Quote Originally Posted by Minty View Post
    That last statement isn't true, unless the controls are already overlapping.
    OK. Now I remember, that whenever wanted to rearrange controls in form e.g to be right aligned (columnwise), when there was the possibility of them partially overlapping after that, I had before aligning to correct the vertical positions for them to avoid this.

  8. #8
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    As a final note, this is what I had to do to keep my sanity.
    I have three rows in a search form. The first is textboxes for what to search, the second is a row of labels, and the third is a continuous form row of textboxes with the data searched for. On the second row are transparent command buttons in front of the labels to initiate sorting.

    1. The first part of the trick is to remove all the labels from the property of the first row of textbox/comboboxes.
    2. Then to align the first row to the left or right and position where wanted.
    3. Next, I made the commands in the other three rows smaller than the corresponding columns in the first row and move a little to the right of where the first row control is positioned.
    4. Select the four controls in the three rows for just one column, starting from the left. Align left and for size. Repeat for each column.
    5. Select a row and size the same then align to top. Repeat for the other three rows of controls.
    6. Resize the control buttons so that one can select the label underneath.
    7. Put the labels back in the textbox/comboboxes controls property.

    Click image for larger version. 

Name:	20240110GrpSrch1.jpg 
Views:	22 
Size:	64.7 KB 
ID:	51318
    Last edited by twgonder; 01-10-2024 at 08:03 AM. Reason: clarify

  9. #9
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    If you have a more modern version of Access you can automate a lot of this with Layout's when designing the form initially.
    It will let you manoeuvre the fields around and automatically realign and resize the matching labels with them, ideal for tabular form layouts.

    It takes a bit of getting used to and you need to adjust the padding settings in the tool bar to get them to budge up to each other, but is definitely quicker than doing it manually.

    It wouldn't assist with your third row of boxes but a quick copy and paste once the initial layout was settled would still be a win.

    https://support.microsoft.com/en-us/...9-a67978b4ce5e
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 02-07-2022, 06:43 PM
  2. Replies: 2
    Last Post: 11-11-2013, 08:39 PM
  3. Replies: 1
    Last Post: 03-27-2012, 12:23 AM
  4. Right Align Listbox
    By brc in forum Access
    Replies: 16
    Last Post: 07-12-2011, 07:06 PM
  5. Align Fields
    By saqqer in forum Programming
    Replies: 1
    Last Post: 08-04-2009, 07:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums