|
-
May 18th, 2004, 01:18 PM
#1
Thread Starter
Lively Member
Combobox
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 doing:
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
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
|