Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2003
    Location
    Manchester, NH
    Posts
    57

    Question Unanswered: Combo box lookup No record found..HELP!

    I have this very basic database I am creating for the purpose of printing and tracking faxes sent out. I am trying to lookup records from a combo box and getting my MsgBox text. It looks as though there is no Bookmark set so when the AfterUpdate event tries to execute it sees no record. My form is based on a query that grabs the ID, CompanyName and CompanyFax. Here is the code as I have it now:

    Private Sub Combo6_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[CompanyName] = '" & Me![Combo6] & "'"

    If rs.NoMatch Then

    MsgBox "No Record Found for " & CompanyName

    Else

    Me.Bookmark = rs.Bookmark

    End If


    Any help would be HUGE right now. Thank you!

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    If it's just a simple one-time lookup (not doing this for thousands of records at once), why not use the Dlookup() function? Check out the Ms Help for more info on it.
    Me.Geek = True

  3. #3
    Join Date
    Apr 2003
    Location
    Manchester, NH
    Posts
    57

    Question well I looked at the Dlookup already.....

    but I am trying to fill out the form with the selection from the combo box. I would just like to figure out how to get around that Bookmark issue. Do I have to set the bookmark on focus or something? Any help or thoughts would be appreciated!

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Just a thought...
    Is it possible that your combo box has more than one column (CompanyID, CompanyName) and CompanyName isn't the bound column?
    Inspiration Through Fermentation

  5. #5
    Join Date
    Apr 2003
    Location
    Manchester, NH
    Posts
    57

    Talking It's a miracle!!!!!!!!!!!!!!

    Yeah guess who has been staring at the code WAYYYYYYYYYYY too long to see minutia like that! GREAT call on the simple details. Thank you very much!!!!!!!!

Posting Permissions

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