Results 1 to 6 of 6
  1. #1
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150

    Listbox column width vs Combobox column widths : Discrepancy

    Hi,



    I am a bit confused with this one.

    I threw together a quick homemade pivot table for this project which uses a listbox and some combo headers to control the rowsource.
    (theres probably an easier way/control to use - feel free to recommend (prefer an unbound solution))

    Anyway, there are combo boxes aligned,sized, and spaced above the listbox to change the field of interest.

    Its probably best at this point to look at the images attached to understand my issue:

    Notice the comboboxes don't align with the columns in the listbox.

    The positioning + widths are all controlled via code at runtime.

    The fact that they don't align makes no sense here: the listbox columns are set to 1". The comboboxes are set to 1" widths and they are all aligned left of eachother.

    Yet there is an error occurring somewhere in the alignment to the listbox and I'm out of thoughts.

    See attached!
    Any ideas?


    Regards

    Click image for larger version. 

Name:	Screen Shot 2020-03-08 at 9.00.12 PM.png 
Views:	15 
Size:	68.2 KB 
ID:	41226Click image for larger version. 

Name:	Screen Shot 2020-03-08 at 9.02.35 PM.png 
Views:	16 
Size:	37.9 KB 
ID:	41227

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Your post says combo column width but to control the width of a combo itself, the property you want to alter is the control width, not the column width. Column width property affects how wide the list is when you drop it down.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150
    Quote Originally Posted by Micron View Post
    Your post says combo column width but to control the width of a combo itself, the property you want to alter is the control width, not the column width. Column width property affects how wide the list is when you drop it down.
    Yes that is a mistake.Admin should change the name to Listbox column width vs Combobox control width: Discrepancy

    You can see in the images what i am trying to achieve. There is an error between the column width of the listbox versus the CONTROL width of the comboboxes.

    Either this is a bug in Access or i am missing something.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Don't know what to tell you except that whatever you're doing in code must be where the problem lies, or perhaps you have a property set in design that is interfering. I was thinking of padding, but IIRC, that only affects text alignment, not control alignment. Works for me just using design and not code:
    Click image for larger version. 

Name:	ComboAlign.jpg 
Views:	13 
Size:	9.6 KB 
ID:	41234

    EDIT - unless the extra .1979" you have in the listbox is the cause, but I'm thinking that just gets added to the last column as extra space. Why have 12 1" columns but a control width of 12.1979"?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150
    Micron,

    the .1979 difference in Listbox control width solved the issue.

    I guess i gave Access too much credit - figured it would logically automatically put any difference at the end of the listbox (last column).

    Thanks for noticing that.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Maybe it would if everything was done in design view. Sometimes code manipulation of objects isn't applied the same as if done in design but I can't recall which properties I've read about that behave that way. I suppose a test would be to replicate the design only via the property sheet and see what Access does with the extra width.
    Glad you got it solved!

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

Similar Threads

  1. Replies: 6
    Last Post: 07-18-2019, 03:09 PM
  2. Listbox column width idea - feedback
    By Homegrownandy in forum Programming
    Replies: 3
    Last Post: 11-21-2016, 04:49 AM
  3. Replies: 3
    Last Post: 04-10-2015, 02:35 PM
  4. Listbox - Column Widths issue
    By Ganesh7299 in forum Access
    Replies: 12
    Last Post: 01-09-2014, 09:38 AM
  5. Fixed column widths in SubForm
    By nyteowl in forum Access
    Replies: 4
    Last Post: 10-15-2010, 02:00 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