Solved

Find a record when the key field is a text field

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

Accepted Solution

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

Expert Comment

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

Open in new window

0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
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
Comment Utility
Jim,

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

772 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

10 Experts available now in Live!

Get 1:1 Help Now