What does the ampersand and $ symbol mean in the following contexts?

ms-access, ms-access-2007, vba

Solution

Hi you can check this question for a possible answer to your query.

Edit: Moreover, I was able to scour the internet for more resources and I found this VBA typing convention which originally found on this forum page.

Hopefully this would help you.

Problem

I'm in the process of a code review and have come across this: ``` Dim lngLen As Long lngLen = 16& ``` I have done some reading and it appears to be that this is a way of casting the number to a long - is that correct? But is that really necessary here as you can just assign `lngLen` the value of 16 because it's a numeric value. Also, following this code this is done: ``` Dim strCompName As String strCompName = String$(lngLen, 0&) ``` I realize the `String` method, from the Access help definitions, "returns a variant containing a repreating character string of the length specified." So what does the $ do? And again is the & casting the 0 to a long?

Original source

Related problems