If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Newbie Sub calling question
Why is it that when I call a subroutine with one variable, I can do
this without generating an error: MySub("some text") But if I reconstruct the sub such that it has two variables and then call it like: MySub("some text", 1) I get an error that says "expected: =" So that I need to do: Dim foo as Integer foo = MySub("some text", 1) ? I'm certain this is a very simple issue, but I tried Googling around and all the examples of subs have a single variable. Thanks for your answers. Tim |
#2
|
|||
|
|||
Newbie Sub calling question
There are 2 different syntaxes to choose from.
1. Call MySub("some text",1) 2. MySub "some text", 1 Note that 1. has brackets, but no spaces between the name of the sub and the variables, which is different from 2. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "Tim" wrote in message ... Why is it that when I call a subroutine with one variable, I can do this without generating an error: MySub("some text") But if I reconstruct the sub such that it has two variables and then call it like: MySub("some text", 1) I get an error that says "expected: =" So that I need to do: Dim foo as Integer foo = MySub("some text", 1) ? I'm certain this is a very simple issue, but I tried Googling around and all the examples of subs have a single variable. Thanks for your answers. Tim |
Thread Tools | |
Display Modes | |
|
|