Results 1 to 5 of 5

Thread: Listbox Help

  1. #1
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Unanswered: Listbox Help

    I need some of my columns to each have a different width... I know this is possible but I am not exactly sure how.



    Code:
    Option Compare Database
    
    Private Sub lst1_AfterUpdate()
        If lst1.Value = "Parts" Then
            With lst2
                .Visible = True
                .Enabled = True
                .RowSourceType = "Value List"
                .RowSource = "Series;Class;Both"
                .ColumnCount = 1
                .ColumnHeads = False
            End With
        ElseIf lst1.Value = "Tools" Then
            With lst2
                .Visible = True
                .Enabled = True
                .RowSourceType = "Table/Query"
                .RowSource = "SELECT Tools.ToolID, Tools.Description, Tools.Width, Tools.Length, Tools.Depth, * FROM Tools;"
                .ColumnCount = 5
                .ColumnHeads = True
                .ColumnWidths = "3"""
            End With
        End If
    End Sub
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Column widths is a single deliminated string.

    So if you had 5 columns with a length of 2:

    .ColumnWidths = "2 in; 2 in; 2 in; 2 in; 2 in"

  3. #3
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Thanks teddy thats exactly what I needed to know
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  4. #4
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Okay now I need help setting width and height... it just isnt working

    I tried the .width "5.125 in" and .height "1.7083 in" it gave me errros.

    Please help
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    the .width property is kind of strange. It will only accept twips.

    1440 twips = 1 inch.

    There for your width should be set to 7380
    Last edited by Teddy; 04-08-04 at 18:57.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •