Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    7

    Unanswered: find record using combo box

    i've seen this question before regarding how to have selecting an item from a combo box, say a last name, take the user to the record with that last name, and the answers always involve using the combo box wizard or using VB.

    is there a way to do this without using either? macros and SQL are fine.

    thanks.

    --lynnepig

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: find record using combo box

    Originally posted by lynnepig
    i've seen this question before regarding how to have selecting an item from a combo box, say a last name, take the user to the record with that last name, and the answers always involve using the combo box wizard or using VB.

    is there a way to do this without using either? macros and SQL are fine.

    thanks.

    --lynnepig
    On the event after update of combo box put this code

    This code found the record in the form whose data mach with the select
    item in the combo box column(0).

    If the data is in other column make this Change in (1):
    ''' cadNameFound = Forms![YourFormName]![MyCombo].Column(n)
    ''' where n is the column number beginning from 0 where your search
    ''' data is

    Private Sub MyCombo_AfterUpdate()
    Dim rst As Recordset
    Dim cadNameFound As String

    Set rst = Me.RecordsetClone
    cadNameFound = Me!MyCombo <------ (1)
    rst.FindFirst "LastName = '" & cadNameFound & "'"
    If rst.NoMatch Then
    MsgBox "Record not Found "
    Else
    Me.Bookmark = rst.Bookmark
    End If
    rst.Close


    Fin:

    End Sub
    Saludos
    Norberto

  3. #3
    Join Date
    Feb 2004
    Posts
    7

    Re: find record using combo box

    this looks like VB to me...

    i am guessing it can't be done without VB. can anyone confirm that for sure?

    --lynnepig

  4. #4
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: find record using combo box

    Originally posted by lynnepig
    this looks like VB to me...

    i am guessing it can't be done without VB. can anyone confirm that for sure?

    --lynnepig
    My be there is another way, for that i need see your base in format Access 97.
    Saludos
    Norberto

  5. #5
    Join Date
    Feb 2004
    Posts
    1
    Is there a way to do this in a data access page in access 2003?

Posting Permissions

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