Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 5th, 2003, 09:50 AM
Registered User
 
Join Date: Dec 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to umagrama
Default String Searching in a Table

Hi all,

I am trying to do a string search in one of the fields in a table. The way I thought of doing it was using a query. It works okay, though it will only find if the user's search matches exactly what I have in the table. It will not work if I want to find for example everyone that has their names beginning with 't'.

How could I make that possible? I want to find various results from the search, not only if it matches exactly.

:?



"When a boy sits next to a girl for a hour, it feels like a minute. Though, when he sits on a hot stove for a minute, it feels like an hour. That's relativity!"
~ A. Einstein
 
Old December 5th, 2003, 09:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

SELECT * FROM YourTable WHERE YourField LIKE 't%'

 
Old December 5th, 2003, 10:55 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are ever stuck in access and need something requiring an expression, just go to help and type "expressions". then view "examples of expressions". It is the most helpful info you can get.
In fact, just try it now.



Sal
 
Old December 5th, 2003, 12:25 PM
Registered User
 
Join Date: Dec 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to umagrama
Default

That helped it. ;)

Thanks guys! I thought that the 'wild card' was the asteristc (*) symbol but no, it is the percentage symbol.

Gotcha!

Hey Sal, you're right. They have many good examples that I can relate to in the help menu. Thanks!

"When a boy sits next to a girl for a hour, it feels like a minute. Though, when he sits on a hot stove for a minute, it feels like an hour. That's relativity!"
~ A. Einstein





Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching a String Hello_kitty Access 1 August 17th, 2005 09:45 AM
Searching Within String zaeem Classic ASP Databases 3 May 10th, 2005 01:06 AM
Searching Within String zaeem VB Databases Basics 1 May 9th, 2005 03:04 PM
Searching for a string.... interrupt Javascript How-To 2 February 7th, 2005 01:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.