Change combobox ColumnCount using VBA

batwings

Registered User.
Local time
Today, 03:28
Joined
Nov 4, 2007
Messages
40
Hi there

Is it possible to change the ColumnCount of a combobox using VBA?
I want to have the Filter2 combobox listed below to use the column to it's right to give me the "Description" of the Item that is selected in the Filter2 and then this text will be output to my report as below...

Code:
 Reports![rptFilterDetail].txtReportTitle.Value = _
        "System: " & Me.Filter1.Value _
        & vbCrLf & "Subsystem: " & Me.Filter2.Value _
        & vbCrLf & "Description: " & [COLOR="Red"]Me.Filter2.Value[/COLOR]

Many thanks
Batwings
 
It depends upon what Column the Description data resides in (within the ComboBox).

Lets assume that there are only two Columns of data within the Filter2 ComboBox and bothl columns are visible (Column Widths property: 1";1").

That means then that Column 0 would be the Subsystem data and Column 1 would be the Description data

Reports![rptFilterDetail].txtReportTitle.Value = _
"System: " & Me.Filter1.Value _
& vbCrLf & "Subsystem: " & Me.Filter2.Column(0) _
& vbCrLf & "Description: " & Me.Filter2.Column(1)

Done Deal...
.
 
Annoying how column 1 in a property is referred to as Column(0) in the underlying code.
 
How true that is but there is a secret reason as to why that is....I can't tell you what that is....because it's a secret :D

.
 

Users who are viewing this thread

Back
Top Bottom