.Column Property - Explain How this Works

R

rl_davis

I realize that I should know the following, but for some reason just
having difficulty with understanding how the following code works.

Can someone walk me through this.

I have a combo box that is used to select the carrier for a shipments.
The best I can figure is that If the combo box is not selected then the
Carrier Name is in the first column of the select statement and the
Carrier name is in the second column in the select statement????


Private Sub Text223_AfterUpdate()

If Text223 <> "" Then
CSCAC = Text223.Column(0, Text223.ListIndex)
CName = Text223.Column(1, Text223.ListIndex)
End If

End Sub


This is something I can not seem to get past.

All help is greatly appreciated.

Thanks

Robert
 
R

Rick Brandt

I realize that I should know the following, but for some reason just
having difficulty with understanding how the following code works.

Can someone walk me through this.

I have a combo box that is used to select the carrier for a shipments.
The best I can figure is that If the combo box is not selected then
the Carrier Name is in the first column of the select statement and
the Carrier name is in the second column in the select statement????


Private Sub Text223_AfterUpdate()

If Text223 <> "" Then
CSCAC = Text223.Column(0, Text223.ListIndex)
CName = Text223.Column(1, Text223.ListIndex)
End If

End Sub


This is something I can not seem to get past.

What do you mean "If the combo box is not selected..."? If there is no
entry in the ComboBox then there is nothing in ANY of the columns either.
In other words your Combo has multiple columns and you are displaying one of
them. If no selection is made in the ComboBox then all of the columns are
Null.
 
V

Van T. Dinh

If there is no value selected in the ComboBox, I *think* the ListIndex is
Null and you have problems using the posted code.
 
Top