Discussion Locked

Bookmark for selected items in DataCom

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a datacombo object called dbcItemNo and getting the listfield from an ADO object.
How do I get the bookmark value of a selected item from the list in the DataCombo?
Or, what is wrong with my method:
Dim vBkmk As Variant vBkmk = dbcItemNo.SeletedItem
'Now scroll record of clicked item in the DataCombo
datAdo.RecordSet.Bookmark = vBkmk
(this datAdo line halts with has a run time error )

7 replies

by c1980

You need to take the value of the selected item and do a FindFirst on the recordset or data controls recordset, (unless the Object gives access to it's underlying recordset or clone, where you could the get a bookmark).

by c1980

You can also filter the forms recordset by using the Filter method:

Me.Filter = "[PersNr]='" & Me.dbcItemNo & "'"
Me.Requery

Make sure that the Me.FilterOn is set to True

by c1980

It would be easier to take the value of the selected item and do a data control's recordset, (you can also use the bookmark of an Object's underlying recordset or recordset clone, if it has one, and set it to the recordset property of the data control's recordset bookmark - the combo box doesn't have this).

by c1980

I meant to say:
It would be easier to take the value of the selected item and do a FindFirst on the data control's recordset.....

But, I see that somehow I answered twice (log on time out or something)

This discussion is closed to new replies.