Use arguments in Visual Basic

Microsoft Office Access 2003

Show All Show All

Use arguments in Visual Basic

  • Specify the arguments immediately after the name of the procedure, statement, or method. For a Function procedure or a method that returns a value, enclose the arguments in parentheses. If you specify more than one argument, separate the arguments with a comma.

For example, the following Close method of the DoCmd object closes the Add Products form. It accepts two arguments, acForm and "Add Products":

DoCmd.Close acForm, "Add Products"
		

Because the Close method doesn't return a value, the arguments aren't enclosed in parentheses.

ShowTip

You can use the Object Browser to paste method or property syntax, including arguments, into your Microsoft Visual Basic code. The Object Browser pastes named arguments that you can specify in any order. You can use these named arguments, or you can replace the named arguments with standard arguments.