I have a database that some coulmns containg numbers and I need to search using the value inputted in a text box. Am unable to do it with this code -
If Combo1.Text = "Result" Then
-
RSSearchS.Open " SELECT * FROM follow WHERE Result = '" & Text2.Text _
-
& "' ORDER BY Workorder", CnWorkOrder, adOpenDynamic, adLockOptimistic
-
where text2.text is the text box that contains the number i want to search for in the database.
Please could you help me out.
Thank you.
3 992 sashi 1,754
Recognized Expert Top Contributor
I have a database that some coulmns containg numbers and I need to search using the value inputted in a text box. Am unable to do it with this code -
If Combo1.Text = "Result" Then
-
RSSearchS.Open " SELECT * FROM follow WHERE Result = '" & Text2.Text _
-
& "' ORDER BY Workorder", CnWorkOrder, adOpenDynamic, adLockOptimistic
-
where text2.text is the text box that contains the number i want to search for in the database.
Please could you help me out.
Thank you.
Hi there,
Take a look at below modification, hope it helps. Good luck & Take care. -
Dim TMPSQL As String
-
-
TMPSQL = ""
-
TMPSQL = "SELECT * FROM follow " _
-
& "WHERE Result LIKE '" & Trim(Text2.Text) & "'" _
-
& "ORDER BY Workorder ASC;"
-
-
If Combo1.Text = "Result" Then
-
RSSearchS.Open TMPSQL, CnWorkOrder, adOpenDynamic, adLockOptimistic
-
EndIf
-
If the field type is numeric, then don't use quotes around the search value. For example... - If Combo1.Text = "Result" Then
-
RSSearchS.Open "SELECT * FROM follow WHERE Result = " & Text2.Text _
-
& " ORDER BY Workorder", CnWorkOrder, adOpenDynamic, adLockOptimistic
[RESOLVED]
Thank you very much.I removed the single quote and it works very well.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: sffan |
last post by:
I am new to database programming and was curious how others solve the
problem of storing encrypted in data in db table columns and then
subsequently searching for these records.
The particular problem that I am facing is in dealing with (privacy)
critical information like credit-card #s and SSNs or business critical
information like sales...
|
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 query should find every machine that has that
part number between the serial number range.
The problem is that the serial number stored is a text...
|
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 criteria:
I have a list of about 100 numbers which correspond to the ID field and also
another 40 say numbers corresponding to the numbers in the...
|
by: inkexit |
last post by:
I need help figuring out what is wrong with my code. I posted here a
few weeks ago with some code about creating self similar melodies in
music. The coding style I'm being taught is apparently a lot different
from what the pros around here use. I really need help with debugging
some program errors more than anything, even though my coding...
|
by: justobservant |
last post by:
When more than one keyword is typed into a search-query, most of the
search-results displayed indicate specified keywords scattered
throughout an entire website of content i.e., this is shown as three
bolded periods '...' in search-result listings.
Additionally, most content is outdated; as many users need up-to-date
content. Hence,...
| |
by: Chrisjc |
last post by:
I would first like to say that I am very new to PHP/MySQL...
I have a database full of infomation already. to view what my database looks like and how it is set up please see the following link ( www.triplesource.net/db/ )
As far as what I have so far this is what I can get my drop down box to do...
( http://www.triplesource.net/php/)...
|
by: ebernedo |
last post by:
Hey guys, I'm new here
and also pretty new to access
I'm creating a database at work, and need to be able to search things within it to find the right part number in our case...
heres a sample of what the table looks like:
Part # Size Press A FlowRate Press B FlowRate Press C Flow Rate
124 1 0.52 ...
|
by: tkip |
last post by:
Hello everyone. I have been working on this DB for quite some time and still can't figure out a way to do what I want to do. It's a database that keep track of drawings and engineering change etc. Aslo, the tables for drawings are grouped by year.
I have a Main Form and on that main form, several cmd buttons to initialize sub forms are...
|
by: lemlimlee |
last post by:
hello,
this is the task i need to do:
For this task, you are to develop a Java program that allows a user to search or sort an array of numbers using an algorithm that the user chooses. The search algorithms that can be used are Linear Search and Binary Search. The sorting algorithms are bubble, selection and Insertion sort.
First, the user...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |