I'm getting an error when I try and use the List1.Selected property - "Argument not optional"
I've used it before. What will cause this?
Thanks,
JO
Printable View
I'm getting an error when I try and use the List1.Selected property - "Argument not optional"
I've used it before. What will cause this?
Thanks,
JO
your code = ???
Oops!
Private Sub List1_Click()
Data1.Recordset.Bookmark = List1.Selected
End Sub
Try this:
Dim aBookMark as variant
aBookMark = data1.recordset.bookmark
**Add this when you want to go back to that bookmark
data1.recordset.bookmark = aBookMark
Also, what your trying, i tried the same code with the datalist, except I used the SelectedItem. adExample.Recordset.Bookmark = datalist.SelectedItem
try using the text property
[Edited by mpSmooth on 11-21-2000 at 10:33 AM]
I think you simply want to do this, which will select the 3rd item in the list (zero selects the 1st item):
List1.Selected(2) = True
None of this seems to be working for me. Let me give you a little more detail...(im new to databases)
I have a from with several text boxes, each linked to a field in a database.
I have a Listbox that populates at form_activate with the contents of a database field:
While Not Data1.Recordset.EOF
List1.AddItem Data1.Recordset!Name
Data1.Recordset.MoveNext
Wend
What I am trying to do is when I click on a name in the list box I need it to show that record in the text boxes on my form.
why not use the datalist box that comes with vb. It's located in the components sections. Nevermind, sorry, I just realized that you are using the standard control. I'll see what I can come up with.
[Edited by mpSmooth on 11-21-2000 at 11:52 AM]