473,399 Members | 2,159 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,399 software developers and data experts.

Text Box Filter using LIKE

Trying to create a filter via a text box where users enter the first
few letters of possible names available. Text box would be connected
to a "LIKE *TEXTBOX*" statement which would filter all records which
match the "LIKE *TEXTBOX*". Sure it wouldn't be hard, but some of the
syntax is tripping me up.

Jeff
Nov 12 '05 #1
2 46338
jeffgeorge wrote:
Trying to create a filter via a text box where users enter the first
few letters of possible names available. Text box would be connected
to a "LIKE *TEXTBOX*" statement which would filter all records which
match the "LIKE *TEXTBOX*". Sure it wouldn't be hard, but some of the
syntax is tripping me up.

Jeff

Jeff,
Where are you doing this?

In a query:
Where [LastName] Like "*" & forms!FormName!ControlName & "*"
The form must be open when the query is run.

On a form to filter the form?

Code the AfterUpdate event of the control:

Me.Filter = "[LastName] Like '*" & [ControlName] & "*'"
Me.FilterOn = True

These filters will return records that have the text anywhere within the
field.
--
Fred
Please reply only to this newsgroup.
I do not respond to personal e-mail.
Nov 12 '05 #2
Jeff,

Try putting the following expression in the appropriate field's criteria of the
form's query:

Like "*" & Forms!NameOfYourForm!NameOfTextBox & "*"
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"jeffgeorge" <ki*******@aol.com> wrote in message
news:4f**************************@posting.google.c om...
Trying to create a filter via a text box where users enter the first
few letters of possible names available. Text box would be connected
to a "LIKE *TEXTBOX*" statement which would filter all records which
match the "LIKE *TEXTBOX*". Sure it wouldn't be hard, but some of the
syntax is tripping me up.

Jeff

Nov 12 '05 #3

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

Similar topics

0
by: Ed | last post by:
------=_NextPart_000_001D_01C34FCC.1D2B5E50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable There seems to be a significant penalty imposed by the...
9
by: Nathan Sokalski | last post by:
I am trying to do a database search using LIKE using the following code: Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click If...
0
by: Sakharam Phapale | last post by:
Hi All, I am developing my own text editor using RichTextBox control. I don't want to use RichTextBox Undo and Redo functions. Instead of that I want to develop my own algorithm for Undo & Redo,...
5
by: flash | last post by:
Hi, I am trying to access a text control using a variable name rather than a fixed id. ie I have a text controls called "tx1" "tx2" "tx3" etc. and i want to set the control using something...
3
by: ASP Developer | last post by:
I have a variety of pages that use a master page. For some reason when I attempt to copy any of the label text on the screen it seems to highlight most of the screen randomly and I can't simply...
4
by: Michael R | last post by:
I'm using this code to filter a form: Me.Form.Filter = "Remarks Is Null" Me.Form.FilterOn = True What code can I use to filter without ruining the previous, already applied filter? Also,...
15
by: Briansmi1116 | last post by:
I created two buttons, that filter my form, They filter in different Fields, and if one is filtered, and the other is not there is a certain amount of record, if they are both pushed, then there is...
3
by: receipt24 | last post by:
Hi I am stuck! this will be easy I am sure for you... I am trying to insert additional text to a text box using the after update function in a form! For example: would like to insert HI...
0
by: satyasri2test | last post by:
Hi, Can some one provide me the complete example for using FILTER USING option in CREATE FUNCTION (External Scalar) for DB2 LUW 9.5. I have verified the sample given in the SQL Reference Volume2,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.