Thread: rs.FindFirst (A2K)
2008-05-29, 22:11 #1
- Join Date
- Feb 2001
- Louisville, Kentucky, USA
- Thanked 0 Times in 0 Posts
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>
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!
+ 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!
2008-05-29, 22:16 #2
- Join Date
- Mar 2002
- Thanked 16 Times in 16 Posts
Re: rs.FindFirst (A2K)
rs.FindFirst "[Member_ID] = " & Me![cboMemberSearch].Column(0) & " And [ID] = '" & Me.[cboMemberSearch].Column(2) & "'"
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.