473,614 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search String in Database Tables

Hello Everyone,

I am new to MS Access and although I have created several different
databases I lack the VB knowledge to code a search function. I am
turning to your expertise for assistance. I am using MS Access 2003.

This is what I am looking for:

A text field for the user to enter the search string or keyword.

Once the user enters the string or a partial string (i.e. *house* or
hou* or *use), the search funtion locates all the records in ALL
database tables that match the string. It is OK for the user to enter
*str or *str* or str* to locate the string (keyword) in all the fields
of ALL database tables.

For output, a new form comes up showing the entire row in the database
table(s) that match the string.

The user moves the mouse pointer to the record, shown on the output
form, to be updated or deleted.

The user updates the record and presses a save button on the form to
store the data back in the table(s). The form also has a delete button
to get rid of the record.

It is OK to illustrate the string search functionality using one
database table; instead of searching multiple tables in the database,
if it is easier to code.

Your expert advice is greatly appreciated.

Thank you,

Edwin

Sep 12 '06 #1
1 11681

at*******@gmail .com wrote:
Hello Everyone,

I am new to MS Access and although I have created several different
databases I lack the VB knowledge to code a search function. I am
turning to your expertise for assistance. I am using MS Access 2003.

This is what I am looking for:

A text field for the user to enter the search string or keyword.

Once the user enters the string or a partial string (i.e. *house* or
hou* or *use), the search funtion locates all the records in ALL
database tables that match the string. It is OK for the user to enter
*str or *str* or str* to locate the string (keyword) in all the fields
of ALL database tables.

For output, a new form comes up showing the entire row in the database
table(s) that match the string.

The user moves the mouse pointer to the record, shown on the output
form, to be updated or deleted.

The user updates the record and presses a save button on the form to
store the data back in the table(s). The form also has a delete button
to get rid of the record.

It is OK to illustrate the string search functionality using one
database table; instead of searching multiple tables in the database,
if it is easier to code.

Your expert advice is greatly appreciated.

Thank you,

Edwin
Sounds like a dodgy design if you're storing the same information in
different fields in different tables (well, unless it's a foreign key).
it's possible to do what you're asking, but if you wanted to union the
results together for all the tables (so you'd get one big list of
matches), the result would not be updateable. I guess you could create
listbox or something and add the number of records matching in each
table...

the basic syntax is

SELECT *
FROM [someTable]
WHERE [somefield] LIKE "*" & Forms!MyForm!tx tSearchString & "*"

Sep 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2636
by: Ryan | last post by:
I'm looking for a stored procedure (or query) to search an entire database for a specific string value and replace it with another. I'm sure I saw an SP for this a while back by someone, but cannot find it again. The SP took the search string and replace string as parameters and did the rest. Any ideas where I can find this ? Bear in mind, the idea is that this can be re-used and run on any database, so it would have to find all tables...
1
1925
by: Tony | last post by:
I have a string which I need to know where it came from in a database. I don't want to spend time coding this so is there a ready made script which takes a string as a parameter and searches all the tables which contain varchar type columns and searches these columns and indicate which tables contain that string? Full text search is not enabled. --
9
20296
by: Christopher Koh | last post by:
I will make a form which will search the database (just like google interface) that will look/match for the exact name in the records of a given fieldname. Any suggestions on how to make the code?
8
3207
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled 'search' may be clicked on by the user and the user can then search all records by postcode. I want to do this to prevent duplicate data entry.
1
1382
by: Matthew Curiale | last post by:
I am trying to create a search page for a database that will display in a repeater, using a stored procedure. The page_load is fine, and calls/displays all rows from the db just fine. When I input something in the search field to display more specific results, the repeater displays blank. Here are the page_load and btnSearch_click subs: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load...
1
6411
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and binding it to a repeater control. This repeater control has multiple text boxes and buttons. Can you please tell me how can i do paging in this case ? I'm posting my code below. The problem is that if i click on "AdjustThisAd" button, it opens...
1
4839
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was wondering if anybody has experienced the same issues
0
2069
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently structured relational database system. The CMS stores articles. The CMS also stores related items --...
0
2716
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only, cannot serch by combine 3 table) Example I have the query table below, how do I make the code to seach based on the query from this: SELECT Product.ID, Product.Description, Quantity.Quantity, Quantity.SeialNo, Quantity.SupplierID,...
0
8197
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, 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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8640
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, 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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8287
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8443
tracyyun
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6093
isladogs
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2573
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
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.