Link to home
Start Free TrialLog in
Avatar of snoble
snoble

asked on

Combo Box - VBA to modify ListWidth

I am trying to manipulate a combox of a form given if Assem is True/False. I finally got the ColumnWidths to work with inserting the Chr(35) charater ( " ), but the ListWidth doesn't want to cooperate with me. The list width won't change no matter what I am doing. It defaults to the width of the combox box and if I tried to insert the Chr(34) but I get an error message saying this property only accepts a number. Any ideas on how to alter the ListWidth Property?

    If Assem = True Then
        Forms![frmPrintJob]![RptCriteria].ColumnHeads = True
        Forms![frmPrintJob]![RptCriteria].ColumnCount = 2
        Forms![frmPrintJob]![RptCriteria].ColumnWidths = 0.7 & Chr(34) & ";" & 2.3 & Chr(34)
        Forms![frmPrintJob]![RptCriteria].ListWidth = 3 <---- Won't alter the List Width
    Else
        Forms![frmPrintJob]![RptCriteria].ColumnHeads = False
        Forms![frmPrintJob]![RptCriteria].ColumnCount = 1
        Forms![frmPrintJob]![RptCriteria].ColumnWidths = 1
        Forms![frmPrintJob]![RptCriteria].ListWidth = 1
    End If
ASKER CERTIFIED SOLUTION
Avatar of Data-Man
Data-Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of snoble
snoble

ASKER

Data-Man,

      Thanks for the info. I am using the Chr(34) on the column widths and that seems to be working fine. I did discover the List Width was obviously not using inches by default by playing around. Thanks for the info.... issue is resolved. Thanks.

Stephen