0

Hi,

How do i select a particular value of a combobox?
Example

combo1.selectvalue(rset.field("id"))

I believe you understand what i mean. I bring data from database and want select it in combo.

Thanks

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by selvaganapathy
0

Hi,
To select a particular item use ListIndex property

combo1.ListIndex = rset.field ( "id" )

Its enough, but to protect from errors

Dim iV as Integer
  ' To avoid Null of record and Convert it to integer
  iV = Val ( rset.Fields( "id" ) & "" )

  'Check the bounding condition

  If iV >= 0 And iV < Combo1.ListCount Then
     combo1.ListIndex = iV
  End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.