Results 1 to 8 of 8
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    sizing


    all, using access 2010. I have a form with a number of fields. One of those fields is a 2 digit state abbr. I set each field a different size according to the data it's holding. All the fields appear to be 1in wide. No matter what I do; the size will not appear as I set it. I don't know what's wrong. I have it set to datasheet view because its a 1:many subform. help

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Design changes made while in Design View do not always translate to Datasheet View. Try opening your form in DS view, click and hold the field name and drag the width of the column to the desired size, like you would in Excel. Now save your form, being careful not to save something like a filter property to your form.

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Thanks for responding. I'll try this.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Or, you could use code like this:

    Code:
    Private Sub Form_Load()
      Me.Field1Name.ColumnWidth = -2
      Me.Field2Name.ColumnWidth = -2
    End Sub

    This causes Controls in Datasheet View Forms to automatically size to fit the widest data in the given column. Just replace Field1Name and Field2Name with your actual names.

    Linq ;0)>

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Huh, I did not know that. I think I am going to use that in the project I am working on now.

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Just one point I thought of, when looking at this again! If it's in the Form_Load event, it sizes the column to the widest data existing when the Form loads! If you put it in the Form_Current event, however, it will resize the columns when the Form loads and when you move off of a New Record, if necessary!

    Linq ;0)>

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Hmm. In DS view I don't think the current event fires unless you change focus from one row to another.

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by ItsMe View Post
    Hmm. In DS view I don't think the current event fires unless you change focus from one row to another.
    Well, yeah! Moving from 'one row to another' is actually moving from one record to another...which is when Form_Current fires in any view! So if you enter a value for a Field that is longer than any previously entered value, for that Field, when you move to another Record the column will resize to accommodate it; you don't have to wait until you re-open the form for this to happen.

    Linq ;0)>

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

Similar Threads

  1. groupheader sizing
    By RayMilhon in forum Reports
    Replies: 9
    Last Post: 09-25-2012, 11:32 AM
  2. Form Sizing
    By Deanos in forum Forms
    Replies: 1
    Last Post: 07-30-2011, 08:45 AM
  3. Sizing of a report
    By ETCallHome in forum Reports
    Replies: 7
    Last Post: 06-25-2011, 10:51 PM
  4. Sizing and positioning
    By 161 in forum Database Design
    Replies: 1
    Last Post: 04-09-2011, 10:52 AM
  5. Pictures sizing
    By newtoAccess in forum Access
    Replies: 0
    Last Post: 11-22-2009, 10:10 AM

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