Solved

Find a record when the key field is a text field

Posted on 2014-01-16
4
302 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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 …

815 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now