List Box Column With

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list box with 10 items / columns. I want to hide and unhide item /
column 3 based on certain conditions.

Here is what I am trying to do but I don't know the syntax:

Me.lstContacts.ColumnCount = 10

lstContacts.ColumnWidth =
0.35";0.95";0";0.45";0.85";0.85";0.95";1.05";1.65";1.65"

lstContacts.ColumnWidth =
0.35";0.95";1.05";0.45";0.85";0.85";0.95";1.05";1.65";1.65"

How cant I toggle the width of item 3 between 0 and 1.05?

Thank You

Ross
 
I have a list box with 10 items / columns. I want to hide and unhide item /
column 3 based on certain conditions.

Here is what I am trying to do but I don't know the syntax:

Me.lstContacts.ColumnCount = 10

lstContacts.ColumnWidth =
0.35";0.95";0";0.45";0.85";0.85";0.95";1.05";1.65";1.65"

lstContacts.ColumnWidth =
0.35";0.95";1.05";0.45";0.85";0.85";0.95";1.05";1.65";1.65"

How cant I toggle the width of item 3 between 0 and 1.05?

Thank You

Ross

Access measurements are in Twips, 1440 per inch.
Convert all of your measurements to twips by multiplying the inch
value by 1440 (i.e. 0.35 * 1440 = 504)
Also, it's the List box's ColumnWidths property, not ColumnWidth that
you need to change.

Code the AfterUpdate of some control:

If Me![ControlName] = SomeCriteria then
lstContacts.ColumnWidths = "504;1368;0;648;1224; ... etc.... ;2376"
Else
lstContacts.ColumnWidths = "504;1368;1512;648;1224 ... etc ...;2376"
End If

Note that the quotes are only used around the entire string, not
within the string.
 
Fred,

I don't know how TWIPS slipped my mind!?

Thank you very much!

fredg said:
I have a list box with 10 items / columns. I want to hide and unhide item /
column 3 based on certain conditions.

Here is what I am trying to do but I don't know the syntax:

Me.lstContacts.ColumnCount = 10

lstContacts.ColumnWidth =
0.35";0.95";0";0.45";0.85";0.85";0.95";1.05";1.65";1.65"

lstContacts.ColumnWidth =
0.35";0.95";1.05";0.45";0.85";0.85";0.95";1.05";1.65";1.65"

How cant I toggle the width of item 3 between 0 and 1.05?

Thank You

Ross

Access measurements are in Twips, 1440 per inch.
Convert all of your measurements to twips by multiplying the inch
value by 1440 (i.e. 0.35 * 1440 = 504)
Also, it's the List box's ColumnWidths property, not ColumnWidth that
you need to change.

Code the AfterUpdate of some control:

If Me![ControlName] = SomeCriteria then
lstContacts.ColumnWidths = "504;1368;0;648;1224; ... etc.... ;2376"
Else
lstContacts.ColumnWidths = "504;1368;1512;648;1224 ... etc ...;2376"
End If

Note that the quotes are only used around the entire string, not
within the string.
 
Back
Top