Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox
Message
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Combobox
Divers
Thread ID:
00905099
Message ID:
00905099
Vues:
60
Hi All:
I have a combo box on my form, and its style is 2-drowdown List. How can I set its newindex or index value to the record ID from my record set. This is what I am trying to do:

oRecData.Open "SELECT Location_Name,Location_ID FROM Locations", oDataConn
If oRecData.RecordCount > 0 Then
For i = 1 To oRecData.RecordCount
With cmboevebldg
.NewIndex = oRecData.Fields("Location_ID")
.AddItem oRecData.Fields("Location_Name")
End With
'combostate.AddItem RTrim(oRecState.Fields("state_Code"))
oRecData.MoveNext
Next i
End If

I get an error when I try to set the newindex. The error is "can not assign to read-only property" What do I need to do in order to assign a value to the index?

Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform