comments

S

Squibbly

how do i show my comments in the vba editor so i know what i am doing to
each field
 
L

Larry Linson

how do i show my comments in
the vba editor so i know what i
am doing to each field

A line which begins with REM is treated as a comment.

Anything to the right of a single-quote ' mark is treated as a comment. That
can be in the first character position to make the entire line a comment, or
it can follow valid VBA statements.

Here's a nonsense function as an example:

Public Function SomeFunc (pstrX as String) as Boolean

REM Purpose: write the purpose of your function
'Input: pstrX = describe the input argument
'Output: describe any arguments that are set for output
'Returns: True for successful operation; False for Error
'Created By: Name of Programmer and Date
'Modified: Name, Date, and reason for modification

SomeFunc = True 'Preset for Success
If Len(pstrX) <= 0 then 'If string is zero-length
SomeFunc = False 'Indicate Error
End If

End Function

If that doesn't answer your question, please post back here to clarify.

Larry Linson
Microsoft Access MVP
 
S

Squibbly

thank you


Larry Linson said:
A line which begins with REM is treated as a comment.

Anything to the right of a single-quote ' mark is treated as a comment.
That
can be in the first character position to make the entire line a comment,
or
it can follow valid VBA statements.

Here's a nonsense function as an example:

Public Function SomeFunc (pstrX as String) as Boolean

REM Purpose: write the purpose of your function
'Input: pstrX = describe the input argument
'Output: describe any arguments that are set for output
'Returns: True for successful operation; False for Error
'Created By: Name of Programmer and Date
'Modified: Name, Date, and reason for modification

SomeFunc = True 'Preset for Success
If Len(pstrX) <= 0 then 'If string is zero-length
SomeFunc = False 'Indicate Error
End If

End Function

If that doesn't answer your question, please post back here to clarify.

Larry Linson
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top