Search for text

R

rbeach

I have a form that I enter information for a search. Currently I have the
below programming in place and it works correctly if I enter the description
exactly as it is in the table (example: I enter "Bag, Tool" to retrieve "Bag,
Tool"). What I need is to enter a partial description and return all of the
items that contain the partial description (example: I enter "Tool" to
retrieve "Bag, Tool") within my list.

The below is the programming I currently have in place for the description
search:

If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] = """ & Me.DescriptionData & """) AND "
End If

I appreciate all assistance.
 
K

kc-mass

You're looking for the "LIKE" function.

If you look for LIKE(*Tool*) it will retrieve "Bag, Tool", "ToolBox",
"Tooling Lathe" et al.

Regards

Kevin
 
R

rbeach

I realize i need the LIKE function, but I do not know how i would restate the
programming for this. Please let me know if you know what the programming
would look like.

Thanks,

--
Rick


kc-mass said:
You're looking for the "LIKE" function.

If you look for LIKE(*Tool*) it will retrieve "Bag, Tool", "ToolBox",
"Tooling Lathe" et al.

Regards

Kevin



rbeach said:
I have a form that I enter information for a search. Currently I have the
below programming in place and it works correctly if I enter the
description
exactly as it is in the table (example: I enter "Bag, Tool" to retrieve
"Bag,
Tool"). What I need is to enter a partial description and return all of
the
items that contain the partial description (example: I enter "Tool" to
retrieve "Bag, Tool") within my list.

The below is the programming I currently have in place for the description
search:

If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] = """ & Me.DescriptionData & """)
AND "
End If

I appreciate all assistance.
 
D

Douglas J. Steele

If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] Like ""*" & Me.DescriptionData &
"*"") AND "
End If


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


rbeach said:
I realize i need the LIKE function, but I do not know how i would restate
the
programming for this. Please let me know if you know what the programming
would look like.

Thanks,

--
Rick


kc-mass said:
You're looking for the "LIKE" function.

If you look for LIKE(*Tool*) it will retrieve "Bag, Tool", "ToolBox",
"Tooling Lathe" et al.

Regards

Kevin



rbeach said:
I have a form that I enter information for a search. Currently I have
the
below programming in place and it works correctly if I enter the
description
exactly as it is in the table (example: I enter "Bag, Tool" to retrieve
"Bag,
Tool"). What I need is to enter a partial description and return all of
the
items that contain the partial description (example: I enter "Tool" to
retrieve "Bag, Tool") within my list.

The below is the programming I currently have in place for the
description
search:

If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] = """ & Me.DescriptionData & """)
AND "
End If

I appreciate all assistance.
 
R

ryguy7272

WHERE (((TableName.[address FieldName]) Like """ & * Me.DescriptionData * &
"""))

LIKE "*" & [Enter any char to search by: ] & "*"

Good luck,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


rbeach said:
I realize i need the LIKE function, but I do not know how i would restate the
programming for this. Please let me know if you know what the programming
would look like.

Thanks,

--
Rick


kc-mass said:
You're looking for the "LIKE" function.

If you look for LIKE(*Tool*) it will retrieve "Bag, Tool", "ToolBox",
"Tooling Lathe" et al.

Regards

Kevin



rbeach said:
I have a form that I enter information for a search. Currently I have the
below programming in place and it works correctly if I enter the
description
exactly as it is in the table (example: I enter "Bag, Tool" to retrieve
"Bag,
Tool"). What I need is to enter a partial description and return all of
the
items that contain the partial description (example: I enter "Tool" to
retrieve "Bag, Tool") within my list.

The below is the programming I currently have in place for the description
search:

If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] = """ & Me.DescriptionData & """)
AND "
End If

I appreciate all assistance.
 
R

rbeach

Douglas, This worked great. Can you tell me why the asterich is between the
last quotes on the first instance and between the first set of quotes on the
second.
--
Rick


Douglas J. Steele said:
If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] Like ""*" & Me.DescriptionData &
"*"") AND "
End If


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


rbeach said:
I realize i need the LIKE function, but I do not know how i would restate
the
programming for this. Please let me know if you know what the programming
would look like.

Thanks,

--
Rick


kc-mass said:
You're looking for the "LIKE" function.

If you look for LIKE(*Tool*) it will retrieve "Bag, Tool", "ToolBox",
"Tooling Lathe" et al.

Regards

Kevin



I have a form that I enter information for a search. Currently I have
the
below programming in place and it works correctly if I enter the
description
exactly as it is in the table (example: I enter "Bag, Tool" to retrieve
"Bag,
Tool"). What I need is to enter a partial description and return all of
the
items that contain the partial description (example: I enter "Tool" to
retrieve "Bag, Tool") within my list.

The below is the programming I currently have in place for the
description
search:

If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] = """ & Me.DescriptionData & """)
AND "
End If

I appreciate all assistance.
 
D

Douglas J. Steele

Let's assume that DescriptionData the single word "something" (without the
quotes).

You'll want strWhere to include

([Desc] Like '*something*') AND

See my May, 2004 "Access Answers" column in Pinnacle Publication's "Smart
Access" for more details. You can download the column (and sample database)
for free at http://www.accessmvp.com/DJSteele/SmartAccess.html

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


rbeach said:
Douglas, This worked great. Can you tell me why the asterich is between
the
last quotes on the first instance and between the first set of quotes on
the
second.
--
Rick


Douglas J. Steele said:
If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] Like ""*" & Me.DescriptionData &
"*"") AND "
End If


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


rbeach said:
I realize i need the LIKE function, but I do not know how i would
restate
the
programming for this. Please let me know if you know what the
programming
would look like.

Thanks,

--
Rick


:

You're looking for the "LIKE" function.

If you look for LIKE(*Tool*) it will retrieve "Bag, Tool", "ToolBox",
"Tooling Lathe" et al.

Regards

Kevin



I have a form that I enter information for a search. Currently I have
the
below programming in place and it works correctly if I enter the
description
exactly as it is in the table (example: I enter "Bag, Tool" to
retrieve
"Bag,
Tool"). What I need is to enter a partial description and return all
of
the
items that contain the partial description (example: I enter "Tool"
to
retrieve "Bag, Tool") within my list.

The below is the programming I currently have in place for the
description
search:

If Not IsNull(Me.DescriptionData) Then
strWhere = strWhere & "([Desc] = """ & Me.DescriptionData &
""")
AND "
End If

I appreciate all assistance.
 
Top