Results 1 to 5 of 5
  1. #1
    hagamablabla is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2017
    Posts
    17

    How does Best Fit choose a field width?


    Whenever I try to autosize a field, Access only looks at the length of the objects currently on screen and adjusts the field width to the longest one on screen. If I try to use Best Fit, however, it seems to pick an arbitrary width that still does not show everything for all records. How and why is it picking this width? Also, if the Best Fit doesn't provide any benefits over autofitting to the longest value in the entire field, how do I adjust the field to the that longest value?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You could try - find the longest value for the field and set the field size.

  3. #3
    hagamablabla is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2017
    Posts
    17
    Is there no alternative? This seems like it would be an obvious thing.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    We're talking about a form in datasheet view? I'd say you answered your own question from the first post - choosing best fit or double clicking on the column border will auto size to the widest value on screen. When you think about it, it's not necessarily a bad thing. For example, if you had a thousand records on the form and only intended to scroll through 50 or so, why would you want the width to be based on ones you can't and maybe won't see, especially if this means you'll now end up scrolling left & right through columns that are wider than they need to be? Then again, if we're talking about a table, it shouldn't be a concern at all.

    If a static width value isn't the way you want to go, you'd have to get the length of each field based on the records returned, which I'd probably do as calculated query fields. But a lot of bother for very little return, methinks.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    if you want the code, you can use Stephen Lebans code here

    http://www.lebans.com/autocolumnwidth.htm

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

Similar Threads

  1. Replies: 11
    Last Post: 06-06-2017, 10:59 AM
  2. Replies: 3
    Last Post: 04-10-2015, 02:35 PM
  3. Can't Choose Field Properties on Query Fields
    By tylerpickering in forum Queries
    Replies: 5
    Last Post: 04-02-2014, 01:56 PM
  4. Section Width is greater than page width
    By snowboarder234 in forum Reports
    Replies: 3
    Last Post: 07-31-2013, 09:06 PM
  5. The section width is greater than the page width?
    By Gary_Marshall in forum Reports
    Replies: 2
    Last Post: 11-13-2009, 01:54 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