Solved

Find a record when the key field is a text field

Posted on 2014-01-16
4
303 Views
Last Modified: 2014-01-16
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
Comment
Question by:SteveL13
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39785262
RS.FindFirst "[TextMnumber] = '" & (Nz(Me![cboFindRecord], 0))  & "'"
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 39785264
Try this:
RS.FindFirst "[TextMnumber] = '" & Nz(Me![cboFindRecord], "0") & "'"

Open in new window

0
 
LVL 57
ID: 39785292
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
 

Author Comment

by:SteveL13
ID: 39785300
Jim,

Yes, you are right.  The whole issue confuses me.  Thanks for the link.  I appreciate it.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question