• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 311
  • Last Modified:

Find a record when the key field is a text field

How can I correct this to work when the key field, TextMnumber, is a text field...

RS.FindFirst "[TextMnumber] = " & Str(Nz(Me![cboFindRecord], 0))
0
SteveL13
Asked:
SteveL13
1 Solution
 
Rey Obrero (Capricorn1)Commented:
RS.FindFirst "[TextMnumber] = '" & (Nz(Me![cboFindRecord], 0))  & "'"
0
 
IrogSintaCommented:
Try this:
RS.FindFirst "[TextMnumber] = '" & Nz(Me![cboFindRecord], "0") & "'"

Open in new window

0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Steve,

 You seem to be struggling a bit with passing strings in code.  With that, you might want to read through this:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_12-Dlookup-and-the-Domain-Functions.html

A large part of that article covers the passing of strings within a string (which you often do in code).

 Might help clear some things up for you.

Jim.
0
 
SteveL13Author Commented:
Jim,

Yes, you are right.  The whole issue confuses me.  Thanks for the link.  I appreciate it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now