DBCombo's click event has the following code:
Data1.Recordset.bookmark & _
= dbcombo1.selecteditem
but it gives an error : Object doesn't support this property or method (Error 438)
please state why.
Printable View
DBCombo's click event has the following code:
Data1.Recordset.bookmark & _
= dbcombo1.selecteditem
but it gives an error : Object doesn't support this property or method (Error 438)
please state why.
It happens because you have DataCombo bounded to a specific field of your data control. It means that it shows only one record at a time. I usually use regular combo box to do the navigation. In a example below I'm using Northwind database that comes with VB, so the field I'm using is CompanyName.
Put this code on Form_Activate event:
Then put this line on Combo1_Click event:Code:Do Until Data1.Recordset.EOF
Combo1.AddItem Data1.Recordset.Fields(1)
Data1.Recordset.MoveNext
Loop
Data1.Recordset.MoveFirst
Combo1.ListIndex = 0
Data1.Recordset.FindFirst "[CompanyName]='" & Combo1.List(Combo1.ListIndex) & "'"
Hope this helps.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
Please, check how dbcombo is connected to Data control. I used RowSourse = Data1 and ListField = some field in the recordset.
I used this procedure:
Private Sub DBCombo1_Click(Area As Integer)
Data1.Recordset.Bookmark _
= DBCombo1.SelectedItem
End Sub
And it works perfect.