J
James P.
Hello there,
I need to create a comboBox named cboStatus as follow:
1) If the user is a manager, display only one status in the comboBox
as "CLOSED" and the default value shown is "CLOSED".
2) If the user is employee, display status with two values "OPEN" and
"PENDING", and the default value shown is "OPEN"
In my design, I set the Row Source Type as "Value List." In the code
in my Form_Open event, I tried different combinations:
If Manager Then
Me.cboStatus.AddItem ("CLOSED")
cboStatus.ItemData(0) = "CLOSED"
Else
cboStatus.RowSource = "OPEN;PENDING"
cboStatus.DefaultValue = "OPEN"
End If
I also tried to set default value with: cboStatus.value =
cboStatus.column(0,0).
So far, the best I got was be able to get the list of values into the
comboBox, but the comboBox shown empty because the default value for
it does not work yet. Either it said type mismatch or can't assign
value to it.
I've been working on this problem for two days and haven't been able
to figure it out. Please help.
Thanks a lot,
Jim
I need to create a comboBox named cboStatus as follow:
1) If the user is a manager, display only one status in the comboBox
as "CLOSED" and the default value shown is "CLOSED".
2) If the user is employee, display status with two values "OPEN" and
"PENDING", and the default value shown is "OPEN"
In my design, I set the Row Source Type as "Value List." In the code
in my Form_Open event, I tried different combinations:
If Manager Then
Me.cboStatus.AddItem ("CLOSED")
cboStatus.ItemData(0) = "CLOSED"
Else
cboStatus.RowSource = "OPEN;PENDING"
cboStatus.DefaultValue = "OPEN"
End If
I also tried to set default value with: cboStatus.value =
cboStatus.column(0,0).
So far, the best I got was be able to get the list of values into the
comboBox, but the comboBox shown empty because the default value for
it does not work yet. Either it said type mismatch or can't assign
value to it.
I've been working on this problem for two days and haven't been able
to figure it out. Please help.
Thanks a lot,
Jim