Solved

Combo Box - VBA to modify ListWidth

Posted on 2004-04-20
2
885 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:snoble
2 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 50 total points
Comment Utility
Snoble,
  you can use this to adjust the column width property

Me.controlname.ColumnWidths = "0.75 in;1 in;0 in;0 in;0 in;0 in"

Me.controlname.ListWidth = "4536"  'This value is in twips.  1440 per inch

Hope this helps,
Mike
0
 
LVL 1

Author Comment

by:snoble
Comment Utility
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
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now