|
-
May 3rd, 2002, 12:33 PM
#1
Combo Box
I have the combo box on the form. The Style property is Dropdown List. It is populated by the code bellow:
Do Until rsNext.EOF
frmLogin.cboTeam.AddItem rsNext![full_name]
frmLogin.cboTeam.ItemData(frmLogin.cboTeam.NewIndex) = rsNext![AssociateID]
rsNext.MoveNext
Loop
I need to select some item, let say 'John Smith', pragmatically. Can I do that?
Thanks
-
May 3rd, 2002, 03:41 PM
#2
Re: Combo Box
Do Until rsNext.EOF
frmLogin.cboTeam.AddItem rsNext![full_name]
frmLogin.cboTeam.ItemData(frmLogin.cboTeam.NewIndex) = rsNext![AssociateID]
If (rsNext![Full_Name] = "John Smith") then
frmLogin.cboTeam.ListIndex = frmLogin.cboTeam.NewIndex
End If
rsNext.MoveNext
Loop
Is that what you want ?
Heulsay
-
May 3rd, 2002, 11:05 PM
#3
Re: Combo Box
You can select a particular value by using following code:
Combo1.listindex = 1
where 1 is the index of item in the list
This will select the second item in the combo box.
Remember Items in Combo start from 0 i.e. Index of first item in combo is 0
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|