Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 29th, 2007, 08:27 AM
Authorized User
 
Join Date: Jul 2004
Location: , , Ireland.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Function to find if a letter is in a word

Hi,

I'm trying to find a function that will return a boolean value showing whether a specific letter appears in a word.

I have a list of thousands of words, and I've created a parameter query asking what letter is being searched for. I want to return all words in the list that contain that letter, but can't see how. I've been looking at InStr, but that's not it.

TIA for any help,
J.

Reply With Quote
  #2 (permalink)  
Old January 29th, 2007, 10:05 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

InStr() IS what you are looking for. It will return a number (the position of the letter in the string) or 0 if the letter is not in the string, so use this as your Boolean:

If result = 0 = False
If result <> 0 = True

Did that work?

mmcdonal
Reply With Quote
  #3 (permalink)  
Old January 29th, 2007, 05:44 PM
Authorized User
 
Join Date: Jul 2004
Location: , , Ireland.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Aha - thanks a lot, mmcdonal, it's working fine now! I was using it wrong, putting in criteria that messed it up.

Cheers,
J.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using Word Function melvik C# 0 September 5th, 2005 01:07 AM
Open Word Doc from Access - find, find next save donaldmaloney Access VBA 1 May 25th, 2005 11:09 AM
Function to Find a Record me2357 Access VBA 5 March 10th, 2005 03:22 PM
Find a Particular Word PanzarPaw Classic ASP Basics 3 November 14th, 2003 10:58 AM



All times are GMT -4. The time now is 01:25 AM.


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