|
-
Sep 5th, 1999, 01:55 PM
#1
Thread Starter
New Member
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.
-
Sep 6th, 1999, 04:21 PM
#2
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:
Code:
Do Until Data1.Recordset.EOF
Combo1.AddItem Data1.Recordset.Fields(1)
Data1.Recordset.MoveNext
Loop
Data1.Recordset.MoveFirst
Combo1.ListIndex = 0
Then put this line on Combo1_Click event:
Data1.Recordset.FindFirst "[CompanyName]='" & Combo1.List(Combo1.ListIndex) & "'"
Hope this helps.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
-
Sep 6th, 1999, 06:18 PM
#3
New Member
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.
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
|