Share via

Subform Column Widths Keep Changing

Anonymous
2012-04-10T14:56:02+00:00

I set the column widths in my subform as I want them, but they keep changing.  For instance, the columns should be .6", .85" and 3.5" (and that's what is also indicated in the properties).  When I open the form the next time, the columns are something like 1.5", 1.3" and 2".  How do I get them to stay as I've adjusted them?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-04-10T18:02:49+00:00
  1. Open your form in design view.
  2. Open the Properties sheet if it isn't already open.
  3. Under the Events tab in the Properties sheet, find the On Load event. Select it.
  4. type [Event  That should autofill to [EventProcedure]
  5. You should see a little builder button to the right of the line. Click it and it will open the code window to the Form_Load Sub
  6. write the line I wrote. When you type Me. a list of items will open. Select your control that you want to size and press Tab.
  7. type a period after the control name and another list will pop up. Select ColumnWidth and Press Tab.
  8. type an equal sign and the width you want just like I did.

And you thought writing code was tough? Nah!

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

11 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-04-10T20:15:29+00:00

    One more question:

    If I want to control the width of three separate columns, can I insert my cursor after the "Me." line, type another "Me." and choose another control?  (So that there will be 3 "Me." lines in total in the body of the sub?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-04-10T20:06:10+00:00

    Thank you!

    P.S.  Your instructions are exactly the kind of work I do. :)

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-04-10T16:41:24+00:00

    Thank you for your quick response.

    Where do I go to create this load event?  (I've never done a load event before.)

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-04-10T15:08:22+00:00

    Use the Form_Load event to set the widths. You have to set them in twips which are 1440 per inch.

    Private Sub Form_Load()

        Me.cboResponse.ColumnWidth = 0.6 * 1440

    End Sub

    Was this answer helpful?

    0 comments No comments