PDA

Click to See Complete Forum and Search --> : Look-up record with DBCombo


Rob Brown
May 29th, 2000, 07:47 PM
Hi,

I'm building a VB5 front-end for an Access 97 database using a standard DAO data control with a dynaset type recordset.

I have a DBCombo control on my form which uses Ref (Autonumber/Primary Key)from tblMain as it's ListField.

The DBCombo is being populated OK but when the user selects a value from the list I want all the other bound controls on the form to display information from the record the user selects. This is not happening.

I have been using the following code:

dtaReport.Recordset.FindFirst "Ref = " & cboIncidentList
dtaReport.Refresh

At run time both these lines of code produce the following error:

'Object does not support this property or method'

Any help would be very much appreciated.

Best Regards,

Rob Brown.

Edneeis
May 30th, 2000, 01:44 PM
DAO Find command needs a DAO.Index="IndexedVaraiable" first if it is a table. If it is a Dynaset I had problems getting it to work right so I switched to ADO although the same method should work in DAO. Use DAO.Filter="SearchField='" & WhatToSearchFor.text & "'"
Check your help topics along that line