Hi All,

I have a list box which is populated from an array in the following manner

VB Code:
  1. For lintCtr = 0 To UBound(ClinicArray, 2)
  2.   '1 for Clinic name
  3.   ClinicList.AddItem ClinicArray(1, lintCtr)
  4.   '0 for Clinic id
  5.   ClinicList.ItemData(lintCtr) = CInt(ClinicArray(0, lintCtr))
  6. Next

Now what I need to do is when I load my new form that it checks in the database for which clinics someone belongs to and then automatically selects them.

For example one person is connected to 2 clinics, clinicid 2 and clinicid 9

These integers match the integers populated in the ItemData options.

How would I go about using the ClinicList.Selected(???) = TRUE?

I have the following but it fails if the clinicid is greater than 9??

VB Code:
  1. Do While Not RS.EOF
  2.      ClinicList.Selected(ClinicList.ItemData(RS("cu_ClinicID"))) = True
  3.      RS.MoveNext
  4. Loop