Results 1 to 2 of 2

Thread: Look-up record with DBCombo

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80

    Unhappy

    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.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width