Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the use of of square brackets in vba (access)

Tags:

vba

ms-access

I'm looking through an access database for work currently and came across some confusing code.

Private Sub Form_Current()
  Me.Parent!PF = Me.[Compound Number]
  Me.Parent.start = Me.[Study Start]
    'over and over for different variables
end sub

I'm wondering what the brackets are for in vba (outside of arrays)and why someone would need this code. Thanks

like image 721
Chris Chevalier Avatar asked May 12 '15 15:05

Chris Chevalier


1 Answers

Without the brackets you would have :

Me.Compound Number

Which would be a call to a routine called Compound with an argument called Number.

The square brackets escape the object name that contains a space (or other reserved characters, symbols or words).

like image 102
Alex K. Avatar answered Sep 29 '22 02:09

Alex K.