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 / Forms Programming / April 2006

Tip: Looking for answers? Try searching our database.

VBA oddity

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BruceM - 27 Apr 2006 17:04 GMT
I had been having a great deal of difficulty attempting to define a string
to be used in a filter.  I was trying to use an unbound form to apply
filtering to a report's recordset.  In the course of doing that I defined
strComp as String, but was having problems with it expecting a "(" (without
the quotes).  Finally I tried:

Dim strComp as String
strComp = "Test Message"
msgBox strComp

Same result.  It wanted a (.  However, when I changed strComp to strCom or
strCompl, no problem.  Does anybody know what I stumbled upon, and are there
any more like it?
Ken Snell (MVP) - 27 Apr 2006 17:10 GMT
StrComp is a VBA function that allows you to compare text strings for match.
That is why you cannot use it as a variable name.

See this MS Office article for information about lists of VBA functions,
etc.:
http://office.microsoft.com/en-us/assistance/HP011361681033.aspx

See these Knowledge Base articles for more information about reserved words
and characters that should not be used:

   List of reserved words in Access 2002 and Access 2003
http://support.microsoft.com/default.aspx?scid=kb;en-us;286335

   List of Microsoft Jet 4.0 reserved words
http://support.microsoft.com/?id=321266

   Special characters that you must avoid when you work with Access
databases
http://support.microsoft.com/?id=826763

Signature

       Ken Snell
<MS ACCESS MVP>

>I had been having a great deal of difficulty attempting to define a string
>to be used in a filter.  I was trying to use an unbound form to apply
[quoted text clipped - 9 lines]
> strCompl, no problem.  Does anybody know what I stumbled upon, and are
> there any more like it?
BruceM - 27 Apr 2006 17:54 GMT
Thanks for the explanation and the links.  I already had the second link
bookmarked, but not the first, which is more comprehensive.  I didn't have
the third link either.  I should have recognized that it was asking for a
parentheses because strComp is a function.

> StrComp is a VBA function that allows you to compare text strings for
> match. That is why you cannot use it as a variable name.
[quoted text clipped - 29 lines]
>> or strCompl, no problem.  Does anybody know what I stumbled upon, and are
>> there any more like it?
 
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



©2008 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.