Question, what are commas

carahorse

Registered User.
Local time
Today, 13:28
Joined
Apr 1, 2013
Messages
36
Question, what are the commas in the

Code:
DoCmd.OpenForm "TableB", , , stLinkCriteria for? what do they do?

 
[code]
 
thanks, New to VBA
 
just wondered if a guy is supposed to put more in the commas or?
 
If you look in VBA help, you'll see that each comma separates an argument. If you skip an optional argument, you still need the comma so Access will know which argument you intend stLinkCriteria to be.
 
If you turn on intellisense (sp?) you can see what they are for each command as you type through them...
 
You may instead of having a long string of commas in the DoCmd statements use named parameter syntax so that the source code is self documenting what argument was receiving each piece of data. Examples:

Code:
DoCmd.OpenForm FormName:=strThisForm, _
               View:=acDesign, _
               WindowMode:=acIcon


'Close window "self"
DoCmd.Close ObjectType:=acForm, _
            ObjectName:=MePointer.Name
 

Users who are viewing this thread

Back
Top Bottom