473,659 Members | 3,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

open a query and display certain records

I have a form that had been setup with a combo box. You'd select a
value from the combo box and a query would open and display matching
records. I now need to remove the combo box and set up a text box so
the user types in a value and the query opens displaying any records
that contain that value in the field. For example, the user enters
"smith" in the text box. The query opens, and filters for any records
that contain *smith* in the name field - since it employs wildcards
and is not an exact match, I'm not entirely certain how to approach
this.
Oct 20 '08 #1
3 3806
Coll wrote:
I have a form that had been setup with a combo box. You'd select a
value from the combo box and a query would open and display matching
records. I now need to remove the combo box and set up a text box so
the user types in a value and the query opens displaying any records
that contain that value in the field. For example, the user enters
"smith" in the text box. The query opens, and filters for any records
that contain *smith* in the name field - since it employs wildcards
and is not an exact match, I'm not entirely certain how to approach
this.
Hi, Coll :)

I've set up that very thing on a database we use. If using just one
searchable field, I found the easiest way was to make the 'find' button
run a form-opening macro where the 'Where condition' is:

[ta_people]![surname] Like '*' & [Forms]![Main
Menu]![find_by_surname _box] & '*'

Only, you know, with your own tables, fields, and form names. ;)

So, my users can type 'smit' in the search field and it'll find: Smith,
Nesmith, and, erm, other things that contain 'smit' in any part of the
surname field. :)

Hope this is helpful. :)

-Jen
Oct 20 '08 #2
On Oct 20, 5:35*am, "Jen P." <jp337sp...@cam .ac.ukwrote:
Coll wrote:
I have a form that had been setup with a combo box. You'd select a
value from the combo box and a query would open and display matching
records. I now need to remove the combo box and set up a text box so
the user types in a value and the query opens displaying any records
that contain that value in the field. For example, the user enters
"smith" in the text box. The query opens, and filters for any records
that contain *smith* in the name field - since it employs wildcards
and is not an exact match, I'm not entirely certain how to approach
this.

Hi, Coll :)

I've set up that very thing on a database we use. *If using just one
searchable field, I found the easiest way was to make the 'find' button
run a form-opening macro where the 'Where condition' is:

[ta_people]![surname] Like '*' & [Forms]![Main
Menu]![find_by_surname _box] & '*'

Only, you know, with your own tables, fields, and form names. ;)

So, my users can type 'smit' in the search field and it'll find: Smith,
Nesmith, and, erm, other things that contain 'smit' in any part of the
surname field. :)

Hope this is helpful. :)

-Jen
Will this approach still work if my button opens a query rather than a
form? Thanks.
Oct 21 '08 #3
On Oct 21, 6:37*am, Coll <col_mcma...@ho tmail.comwrote:
On Oct 20, 5:35*am, "Jen P." <jp337sp...@cam .ac.ukwrote:


Coll wrote:
I have a form that had been setup with a combo box. You'd select a
value from the combo box and a query would open and display matching
records. I now need to remove the combo box and set up a text box so
the user types in a value and the query opens displaying any records
that contain that value in the field. For example, the user enters
"smith" in the text box. The query opens, and filters for any records
that contain *smith* in the name field - since it employs wildcards
and is not an exact match, I'm not entirely certain how to approach
this.
Hi, Coll :)
I've set up that very thing on a database we use. *If using just one
searchable field, I found the easiest way was to make the 'find' button
run a form-opening macro where the 'Where condition' is:
[ta_people]![surname] Like '*' & [Forms]![Main
Menu]![find_by_surname _box] & '*'
Only, you know, with your own tables, fields, and form names. ;)
So, my users can type 'smit' in the search field and it'll find: Smith,
Nesmith, and, erm, other things that contain 'smit' in any part of the
surname field. :)
Hope this is helpful. :)
-Jen

Will this approach still work if my button opens a query rather than a
form? Thanks.- Hide quoted text -

- Show quoted text -
Coll,

Not sure if it will or not. But if it doesn't, you can always create
a form that looks exactly like the query using the form wizard with
the query as the source. If you'd rather show it as a datasheet view,
then people would never know the difference.

You could also write the query so that the criteria box for your query
field contains the "like" concatenation she showed. The only problem
is that you are permanently pointing to your form. And that's only a
problem if you want to reuse that query.

Jon
Oct 21 '08 #4

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

Similar topics

2
2411
by: Lin Ma | last post by:
Greetings, In my search application, user can type a number to search. I use LIKE in my query. If a query result generates over 10,000 recordsets, it may several minutes to run. Is there a way to only query certain recordset at a time?
5
2250
by: Jerome | last post by:
Hi, I've got the following problem: I want my ASP page to display a certain number (based on a COUNT query), it works fine if the result is at least 1! If there are no records to be counted (= the query is empty), I get errors. What I've tried is this:
7
682735
by: vnl | last post by:
I'm trying to run a SQL query but can't find any records when trying to select a certain date. Here's the sql: SELECT field 1, field2, date_and_time, FROM table1 WHERE date_and_time = '01-SEP-02' I'm getting no results. The date_and_time field is formatted like this: 2002-SEP-02 00:01:04
5
2678
by: Daniel Tan | last post by:
Are there anyway to copy rows of records from one query to another query and then hide the records in source query ? Pls advise. Thanks. Regards, Daniel
8
17218
by: Bill | last post by:
Hello out there; This may be a challenge but I'm certain it's possible but I can't seem to figure out how. I have a table that has several date fields, e.g., Date1, Date2, Date3, Date4 ... etc. I wish to find out either of two things for each row. 1) What is the maximun date in any of the date fields in the row.
1
2759
by: VMI | last post by:
I need to display Access data in a datagrid but the Access table has over 2 million records. Since I can't fill a datatable with all those records but the user needs to see all of them, how can I fill the datatable with a subset of the initial query result? In the windows Form, under the datagrid, I was thinking of adding a "Next" button that would display the next N records from the initial query, and a "Previous" that would display the...
1
5309
by: starke1120 | last post by:
Is there a way to open a form based on query type.. Example.. If a certain query result is 1 then open the form to this result.. If the query results are NULL or 0 results, then open open for in add or add new record form. The query will return one to 0 records so this is my option. Im guessing the form load event would be the place but not sure how to go about it.
5
4136
by: Bob Bridges | last post by:
Start with two tables, parent records in one and child records in the other, a one-to-many relationship. Create a select statement joining the two. Display the query in datasheet mode. When I delete a row, only the child record is deleted from the source tables; the parent record is still there...which is what I wanted. Now display fields from that query in a continuous form. When I delete a record from that form, one of the child...
7
2469
by: servantofone | last post by:
I'm using Access 2003. I'm building a query and wish to display all records with values in a certain field (HIST) made up of all zeros. The field has a range of text values including alpha-numeric characters and may look as follows: "0000000" "10112B1A" "0000" "***111B001" "0000000000" "111000" "0" "00000000000"
0
8851
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
8531
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
8628
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...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
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
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
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.