473,395 Members | 1,466 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,395 software developers and data experts.

Find Using Wildcard

Hi, I am very new to visual basic and am using a select case statement with something called fSort. I found the code on a website but I need to modify it a little. I have a phrase and want to replace it with another phrase kind of like a Find and Replace tool. I have:

Case "doesn't exist in Boston", "doesn't exist in New York", "doesn't exist in Atlanta"
fSort = "doesn't exist"

but there are a ton more cities I want to include in the case statement so instead of typing one long case statement I want to know if I can use a wild card or wild character to replace the city name. For instance:

Case "doesn't exist in *wildcard*"
fSort = "doesn't exitst"

Can I do something like that?
Thanks.
Mar 14 '08 #1
5 3073
missinglinq
3,532 Expert 2GB
Gemini1617, if you're saying that regardless of the city name, you want fSort to equal "doesn't exist" if the beginning of your field is "doesn't exist in" then, assuming the textbox holding this phrase is YourTextBox, you can use the example NeoPa just posted.

Expand|Select|Wrap|Line Numbers
  1. Select Case True
  2.   Case  Left(Me.YourTextBox,16) = "doesn't exist in"
  3.     fSort = "doesn't exist"
  4. End Select
Welcome to TheScripts!

Linq ;0)>

Mar 14 '08 #2
Linq,
Thank you, it worked!
Mar 14 '08 #3
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Mar 14 '08 #4
NeoPa
32,556 Expert Mod 16PB
Gemini,

Welcome to TheScripts, but please don't post your question in somebody else's thread in future.

I have split this away from Understanding the Select Case Statement and into its own thread now.
Mar 14 '08 #5
NeoPa
32,556 Expert Mod 16PB
Remember too, a Select Case statement is only warranted if you have multiple situations to handle. If you simply want to execute the logic you mention, you can use :
Expand|Select|Wrap|Line Numbers
  1. If LCase(Left(YourTextBox, 17)) = "doesn't exist in " Then _
  2.     fSort = "doesn't exist"
Mar 14 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: DaveS | last post by:
Hello, I'm using Oracle 9.2 and would like to automatically save a copy of each deleted record in XML format to another database table. There would be one XML record for each deleted record. ...
1
by: deko | last post by:
I have a form where users can enter a string with asterisks to perform a wildcard search. Currently, the string entered by the user looks like this: *somestring* The purpose is to match any...
1
by: Law.Win | last post by:
I have an IIF statement in the criteria of a query. I would like to know how to use a wildcard with the varaibles inside it. For example IIF(, , ) I would like the wildcard after variable 2. ...
2
by: Ken Yee | last post by:
First a little background: I've written an httphandler to handle wildcard extensions (i.e., I want to handle all URLs that come in rather than just URLs w/ a specific file extension so I can give...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
6
by: Jan Kucera | last post by:
Hi, does anybody know about wildcard mapping ASP.NET 2 in IIS6? Any tutorial? Thanks, Jan
1
by: Lucvdv | last post by:
In my assembly.vb files, I'm using the revision/build wildcard style: <Assembly: AssemblyVersion("3.0.*")> <Assembly: AssemblyFileVersion("3.0.*")> This onkly seems to work in projects that...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
Is it possible to use a wildcard like feature with Dataview.Find? Actually, I tried that but did not get any rows. Is there some wildcard like feature of the dataview or some other object that I...
7
by: BlackJack17 | last post by:
I have another newbie question for you guys... I apologize in advance for how simple it is... I've got a string of data, included in that string is 11* as it appears, the * is not a wildcard. ...
0
by: savage678 | last post by:
Hi Everyone, I am new to this forum and am i dire need of some help. I am trying to use wildcard searches in infopath. I have it connected to an access database using data connection. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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...

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.