• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Variables, Data Types, and Constants > 10.2. Line Continuation

Line Continuation

The very nature of Access VBA syntax often leads to long lines of code, which can be difficult to read, especially if we need to scroll horizontally to see the entire line. For this reason, Microsoft recently introduced a line-continuation character into VBA. This character is the underscore, which must be preceded by a space and cannot be followed by any other characters (including comments). For example, the following code:

Set rs = CurrentDb.OpenRecordset("Names",  _
	dbOpenForwardOnly)

is treated as one line by Access.

It is important to note that a line-continuation character cannot be inserted in the middle of a literal string constant, which is enclosed in quotation marks.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint