IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Access
Search Access Group:

Advanced
-Collapse +Expand Access To/From
To/FromCODEGuides
-Collapse +Expand Access Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Access & VBAAccess VBALanguage Basics   Print This     
Next Random Article Next Random Tidbit || Change Topic Random From All
  From the January 2016 Issue of Prestwood eMag
 
Access Language Basics:
Access VBA Comments (' or REM)
 
Posted 13 years ago on 11/14/2008 and updated 1/29/2009
Access Code Snippet:
 A flashcard from our Access Flashcards Library
 A code snippet from our Access Code Snippets Page

KB101499

Languages Focus: Comments

Commenting code generally has three purposes: to document your code, for psuedo coding prior to coding, and to embed compiler directives. Most languages support both a single line comment and a multiple line comment. Some languages also use comments to give instructions to the compiler or interpreter.

Access VBA Comments

Commenting Code
Access VBA, like all the VB-based languages, uses a single quote (') or the original class-style basic "REM" (most developers just use a quote). Access VBA does NOT have a multiple line comment.

Directives - #

Directives are sometimes called compiler or preprocessor directives. A # is used for directives within Access VBA code. Access VBA offers only an #If..then/#ElseIf/#Else directive.

Syntax Example:
'Single line comment.

REM Old school single line comment.

#If MyDirective Then
'...some code.
#End If

Multi-Line Comment Code Trick

You can simulate a multi-line comment with code which is useful especially if you wish to comment out a block of code.

For example:

If False Then
 '...code here skipped.
End If

Using Directives

Here is a simple example of using VB Classic's directive (change True to False to switch it).

#Const MyDirective = True

#If MyDirective Then
      MsgBox ("Yes")
#Else
      MsgBox ("No")
#End If

More Info


Comments

1 Comments.
Share a thought or comment...
Comment 1 of 2

An access vba comments, the more objectives I have ever seen and sharing the great thoughts as well. I am getting here top essay writing service the more educational tips and wonderful british assignments.

Posted 19 months ago

Comment 2 of 2

“Welcome to We Buy Houses Philadelphia, the Official Cash Home Buyer of Philadelphia, Pennsylvania, and surrounding areas.

We provide home sellers with a cash option to purchase their property quickly—with NO Repairs, and NO Fees or Commissions.

Simply go to our website or call us at (215) 515-0050 to get a no-obligation cash home offer sent to you. It’s free and confidential.

Avoiding foreclosure? Facing divorce? Moving? Upside down in your mortgage? Liens? It doesn’t matter whether you live in it, you’re renting it out, it’s vacant, or not even habitable. We help owners who have inherited an unwanted property, own a vacant house, are behind on payments, owe liens, downsized, and can’t sell… even if the house needs repairs that you can’t pay for… and yes, even if the house is fire damaged or has bad rental tenants.

Basically, if you have a property and need to sell it… we’d like to make you a fair cash offer and close on it when you’re ready to sell.

Just contact us today to get started!

Posted 7 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1182A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101499 Counter
23361
Since 11/14/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2021 Prestwood IT Solutions.   [Security & Privacy]