Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    597
    Thanks
    0
    Thanked 0 Times in 0 Posts

    rs.FindFirst (A2K)

    I should know this but don't...I simply don't.

    I need to find a record on the form based on column0, (numeric) and column2 (text) of a combo box. No matter what I do, I get a data mismatch error. Can someone please help?

    I'm using the following code:

    rs.FindFirst "[Member_ID] = '" & Me![cboMemberSearch].Column(0) & "'" & "And [ID] = '" & Me.[cboMemberSearch].Column(2) & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

    In debug, I can get the correct value for column2 but not column0.

    Someone PLEASE SAVE ME!!!

    Thanks in advance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 15 Times in 15 Posts

    Re: rs.FindFirst (A2K)

    Try
    <code>
    rs.FindFirst "[Member_ID] = " & Me![cboMemberSearch].Column(0) & " And [ID] = '" & Me.[cboMemberSearch].Column(2) & "'"
    </code>
    Since column 0 is numeric, there shouldn't be quotes (single or double) around the value.
    Instead of rs.EOF I'd use rs.NoMatch.

Posting Permissions

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