473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Searching For a text field

Stang02GT
1,208 Expert 1GB
Hello,

I want to be able to have a user search for a customer by their name. I have "name" feild in my DB and have a text box on a form where the user can enter the customers name and click a "Search" button to execute the search.


I have done this before by searching for a number. But i think I have to change something with the code because i am searching for text and not a number.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command27_Click()
  2.    If IsNull(Text32) = False Then
  3.       Me.Recordset.FindFirst "[Name]"=' & Text32
  4.       Me!Text32 = Null
  5.       If Me.Recordset.NoMatch Then
  6.          MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
  7.             Me!Text32 = Null
  8.       End If
  9.    End If
  10. End Sub
I think my problem lies i the bolded area. Maybe i need to change the " "'s or something like that.
Oct 19 '07 #1
1 2219
missinglinq
3,532 Expert 2GB
Try replacing

Me.Recordset.FindFirst "[Name]"=' & Text32


with

Me.Recordset.FindFirst "[Name] = '" & Me![Text32] & "'"

Linq ;0)>
Oct 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Chris Chandler | last post by:
Hello I am developing a web application that uses full text searching quite extensively. This is ideal where I am searching a large number of large varchar fields for a set of key words. My...
1
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
3
by: Stewart Allen | last post by:
Hi there I'm trying to find part serial numbers between 2 numbers. The user selects a part number from a combo box and then enters a range of serial numbers into 2 text boxes and the resulting...
8
by: David | last post by:
Hi, I have a form as follows: Main Form (To Select Customer) Sub Form 1 (To Select PO Number, by clicking on field) - Continuous form Sub Form 2 (To view order details)- Continuous form...
3
by: Paul H | last post by:
I have a text file that contains the following: ******************** __StartCustomerID_41 Name: Fred Smith Address: 57 Pew Road Croydon
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
1
Corster
by: Corster | last post by:
I went through a great deal of hassle to figure this out for myself, but now it is complete, I would like to share it with the world! I know afew other people have had trouble with FindFirst and...
5
by: sree078 | last post by:
Hi I've a list of Values with varchar field in main in a table. I wanted to have fast search as there are very less insertions/updations. Thought to do a FullText Searching on that varchar field....
0
by: Kassimu | last post by:
Hi guys out there, There is this database Iam creating, I have a table with 40 fields among which there are Date/time, Text, Number, Memo and Yes/No fields and I have created the form bound to that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.