Access 365 form with Listbox I want user at runtime to be able to change the width of a column

Anonymous
2022-05-18T23:56:14+00:00

Saddly they seems to be lock and can't be change most be a very simple property that I completly miss

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
{count} votes

6 answers

Sort by: Most helpful
  1. Anonymous
    2022-05-19T00:38:22+00:00

    Hi Marc, I will try to help.

    It looks like you are using a subform on a tab control to display your data. The user should be able to drag the border of a column to size it. Have you tried that?

    0 comments No comments
  2. Anonymous
    2022-05-19T02:14:26+00:00

    That is a form where my employee list is shown, I would like at run time. To resize but I can't.

    0 comments No comments
  3. Anonymous
    2022-05-19T02:30:11+00:00

    Again did you try dragging the borders? Are you running an accde or using the Access Runtime?

    0 comments No comments
  4. Duane Hookom 26,600 Reputation points Volunteer Moderator
    2022-05-19T16:26:11+00:00

    If this is truly a listbox (I trust it is) then it would take a fair amount of VBA code to change the Column Widths property based on the the position of the mouse at the moment a mouse down is captured. If you really want to push this, here is basic code to display the position of the mouse over the listbox. I have two text boxes, txtMouseX and txtMouseY.

    Private Sub List0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 
    
        Me.txtMouseX = X 
    
        Me.txtMouseY = Y 
    
    End Sub
    
    0 comments No comments
  5. Anonymous
    2022-05-19T16:58:01+00:00

    As Duane has said, to do this with a list box would require that you write some far from trivial VBA code.  It would be far simpler to use a subform in place of the list box.  You might like to take a look at FindRecord.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    This little demo file includes an option to Open simulated 'split form'.  In this the subform is by default in continuous forms view, but if you were to change the subform's DefaultView property to Datasheet you would find that you can click and drag the right borders of the columns in the way that Scott has described.

    I expect that you could do the same if you were to create a true split form using the built in functionality.

    0 comments No comments