Mulitiple FindFirst Criteria

  • Thread starter Thread starter Andy G
  • Start date Start date
A

Andy G

I am trying to locate a record from a recordset clone with 2 criteria, here
is the code. Can I do this?

Set rsDisplayAddr = Me.RecordsetClone
rsDisplayAddr.FindFirst "[CONTACT_Contact_ID]=myID" And
[ADDR_MailingAddr] = True


Thanks!
 
Assuming that "myID" is either a variable that is in scope when this code
runs or a control on the same form that contains the code, and that
"Contact_Contact_ID" is a numeric, not a text field, then something like the
following should work ...

rsDisplayAddr.FindFirst "Contact_Contact_ID = " & myID & " And
ADDR_MailingAddr = True"

The square brackets in your original example should not be necessary,
although they should not do any harm.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top