DataBase - Using "Like" Operator in "Select Case" Statement
Asked By LA Lawyer
03-Feb-10 04:44 PM
I want to use a "like" operator in a Select Case statement; I am sure that
there is some way to do something like this. Here is what I have to do:
Select Case ClassOfContact
Case "Bob's client", "Mary's client", "Our clients". . . . .
......
Case "Vendors"
......
End Select
Obviously, it would be safer and faster to use something like a Like
operator, such as "Like "*client*", but Access 2007 rejects the Like
operator.
Is there a way to do that? Is this a limitation of Select Case? What are
my options? What do the smart people do?
Incidentally, is the Like operator case sensitive?
Access 2007
(1)
LINQ
(1)
VBA
(1)
Debug.Print
(1)
ClassOfContact
(1)
CaseAn
(1)
Rejects
(1)
Safer
(1)
Marshall Barton replied to LA Lawyer
Yes, it is a limitation of Select Case
An alternative could be to use something like:
Select Case True
Case ClassOfContact Like "*client*"
...
Case ClassOfContact = "Vendors"
...
No
--
Marsh
MVP [MS Access]
Tom van Stiphout replied to LA Lawyer
You write "I am sure...". What makes you so sure?
You can do this, and it is close to what you want but no cigar:
Dim s As String
s = "aaa client"
Select Case s Like "*client*"
Case True
Debug.Print "True"
Case Else
Debug.Print "Else"
End Select
If you want to know how this works, look up "Like Operator" in the
help file.
The more general case you are hinted at would require a technology like
LINQ which is not part of VBA.
-Tom.
Microsoft Access MVP

Roger Jennings on Access / Sharepoint DataBase http: / / www.quepublishing.com / articles / article.aspx?p = 1606238 I was very dismayed is it makes it pretty clear that in-house hosting of your Sharepoint server with Access Services to support browser-based Access apps is something only large companies will be able to afford, because the pricing and licensing for the Enterprise version is very, very steep. The alternative is hosted Sharepoint / Access Services, and the costs do not seem terribly high. It seems to me that the pricing is upside-down. Big enterprises do not want to deploy Access apps in the browser - - they will build their own .NET apps, browser-based or not 2010, it could vastly increase those costs for organizations with legacy hardware). The features of Access 2010 used in conjunction with Sharepoint 2010 seem to me to be most compelling for and small businesses. I do not know if I could sell clients on hosted Sharepoint / Access. I have been able to sell clients on hosted Exchange, and it is been very W. Fenton http: / / www.dfenton.com / contact via website only http: / / www.dfenton.com / DFA / Access Discussions SQL Express (1) SQL Server (1) MySQL (1) Exchange Server (1) Windows Server (1
Access 2010 with Sharepoint 2010 DataBase I found this article http: / / sharepointproconnections.com / Articles / tabid / 149 to me was these two points: client." Hopefully this means you can test out the Access 2010 in a browser capabilities. 2.0 AA compliance. Level 1 browsers, which support 100 on other platforms. Level 2 browsers will have some limitations in rendering and behavior." Bob Access Discussions SQL Server (1) MySQL (1) Visual Basic for Applications (1) SharePoint (1) Access 2007 (1) Access 2010 (1) Office 2003 (1) Windows 7 (1) Well, the question is do you really now we build applications to the office standard (that might use outlook, excel, and MS access on the desktop), in the future we build applications that does all the similar functions reusable for more than one client. So we now develop to a office standard (and VBA). Our next and software for the cloud will be built to the sharepoint standard (at
Access 2010 for software development DataBase Hi, What do I need to use Access 2010 (or perhaps 2007) to port our 2003 application and create an executable (MDE in Access 2003)? Are there any issues with 2010? -paulw Access Discussions SQL Server (1) SharePoint (1) Albert D. Kallal (1) Office 2007 (1) Office 2003 (1) Access 2007 (1) Access 2010 (1) Access 2003 (1) You can use Access 2010 to develop your
correct term. I am talking about Dbs to which you set a reference in the VBA references section. Secondly apologies for sort-of reposting this question, but I drew blanks last in the library and seeing how many forms there are. Any help gratefully received Phil Access Discussions David W. Fenton (1) Access 2007 (1) Office 2007 (1) Windows 7 (1) Distributed (1) Exception (1) Relative (1) Declare (1) Library is the means no MDEs, right? That would be a complete showstopper for a large population of Access developers, I think. It would not be for me in all my apps, but for to the Menu db that it does not reload it. I can remove the reference (Access.References.Remove RefName), but then I have to compact and repair the Db before adding the Tools-> References section. As far as I know it is not possible to use VBA to compact and repair. I cannot find any way of removing the reference from the
Considerations migrating from Access 97 mdb to Access 2003 (or up)? DataBase What are the things I need to watch for? I know for? We're kind of at the end of the road (so it seems) with Access 97. It does not play well with Windows 7 Professional even in XP Mode, the is crashy / unsreponsive at times. I figure moving up to a more 'modern' version of Access can help alleviate some of these problems and allow it to run native in Windows XP mode. So I am all ears for recommendations on migration or ways to get Access 97 to work properly in Win 7. Thanks a bunch. Access Discussions Visual Studio .NET (1) Windows XP (1) Office 2007 (1) Access 2007 (1) Access 2003 (1) Access 2010 (1) Windows 7 (1) Panes (1) Hi Ryan