Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

Wildcard in Instr?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mcl - 23 Apr 2008 22:50 GMT
Is it possible to use single charcater wildcards in "InStr"?
In this case I wanted to search for a "/" preceeded and followed by 2
numerical characters but it didn't work.
May I assume it can't be done or did I just use the wrong syntax?

This is what I used. I was able to search for just a "/" but when I added
the #'s it was a no go.
InStr([Remark],"##/##")
George Nicholson - 23 Apr 2008 23:03 GMT
Instr() doesn't support wildcards.  Check out VBA's Like operator

bolResult = [Remark]  Like  "*##/##*"

Signature

HTH,
George

> Is it possible to use single charcater wildcards in "InStr"?
> In this case I wanted to search for a "/" preceeded and followed by 2
[quoted text clipped - 4 lines]
> the #'s it was a no go.
> InStr([Remark],"##/##")
Marshall Barton - 23 Apr 2008 23:27 GMT
>Is it possible to use single charcater wildcards in "InStr"?
>In this case I wanted to search for a "/" preceeded and followed by 2
[quoted text clipped - 4 lines]
>the #'s it was a no go.
>InStr([Remark],"##/##")

No wildcards with InStr, but easy enough to add it to your
code:

pos = InStr(pos+1,Remark,"/")
If pos > 0 Then
    If Mid(Remark,pos-1,3) Like "##/##" Then
        . . .

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.