From: alex on
On Mar 22, 8:57 am, Stefan Hoffmann <ste...(a)ste5an.de> wrote:
> hi Alex,
>
> On 18.03.2010 19:26, alex wrote:
>
> > Also, how could I open/close>  1 table; e.g., call
> > OpenCloseTable("myTable1" and "myTable2","")?
>
> Public Sub ParamArrayTest(ParamArray AParamArray() As Variant)
>
>    Dim value As Variant
>
>    For Each value In AParamArray()
>      If VarType(value) = vbString Then
>        Debug.Print value;
>      End If
>    Next value
>    Debug.Print
>
> End Sub
>
> In the immediate window:
>
> ParamArrayTest "1", "2", "3", 4, "5"
> 1235!
>
> The ParamArray data type must be Variant.
>
> mfG
> --> stefan <--

Thanks for the help guys...
I'll give it a try.
alex
From: alex on
On Mar 23, 9:35 am, alex <sql_...(a)yahoo.com> wrote:
> On Mar 22, 8:57 am, Stefan Hoffmann <ste...(a)ste5an.de> wrote:
>
>
>
>
>
> > hi Alex,
>
> > On 18.03.2010 19:26, alex wrote:
>
> > > Also, how could I open/close>  1 table; e.g., call
> > > OpenCloseTable("myTable1" and "myTable2","")?
>
> > Public Sub ParamArrayTest(ParamArray AParamArray() As Variant)
>
> >    Dim value As Variant
>
> >    For Each value In AParamArray()
> >      If VarType(value) = vbString Then
> >        Debug.Print value;
> >      End If
> >    Next value
> >    Debug.Print
>
> > End Sub
>
> > In the immediate window:
>
> > ParamArrayTest "1", "2", "3", 4, "5"
> > 1235!
>
> > The ParamArray data type must be Variant.
>
> > mfG
> > --> stefan <--
>
> Thanks for the help guys...
> I'll give it a try.
> alex- Hide quoted text -
>
> - Show quoted text -

Hi John,

>I get no error (A2000 mdb and A2007 mdb & accdb) with either:
>OpenCloseTable , "tableName" or OpenCloseTable "tableName" in both cases the
>unspecified optional argument defaults to "".

The reason I was getting the error is because I was calling the sub
like so:

Call OpenCloseTable "TableName"

Without 'Call' I don't get an error.

So...When are you supposed to use 'Call'? (I've always used it!) I
couldn't find anything definitive on the net.

Thanks,
alex
From: Stefan Hoffmann on
hi Alex,

Not being John, neither Malkovich...

On 24.03.2010 12:12, alex wrote:
> The reason I was getting the error is because I was calling the sub
> like so:
>
> Call OpenCloseTable "TableName"
>
> Without 'Call' I don't get an error.
>
> So...When are you supposed to use 'Call'? (I've always used it!) I
> couldn't find anything definitive on the net.
When using the Call syntax you need to enclose the parameters in
parentheses:

Call OpenCloseTable("TableName")


mfG
--> stefan <--
From: alex on
On Mar 24, 9:15 am, Stefan Hoffmann <ste...(a)ste5an.de> wrote:
> hi Alex,
>
> Not being John, neither Malkovich...
>
> On 24.03.2010 12:12, alex wrote:> The reason I was getting the error is because I was calling the sub
> > like so:
>
> > Call OpenCloseTable "TableName"
>
> > Without 'Call' I don't get an error.
>
> > So...When are you supposed to use 'Call'? (I've always used it!)  I
> > couldn't find anything definitive on the net.
>
> When using the Call syntax you need to enclose the parameters in
> parentheses:
>
>   Call OpenCloseTable("TableName")
>
> mfG
> --> stefan <--

Thanks Stefan; I'll take your advice anyday!
So there's no functionality difference, only that the Call syntax
requires parentheses (like a function).
alex
From: Jon Lewis on
Call is normally used when 'calling' a function when you want to ignore the
result. Remember a Function normally returns a value whereas a Sub normally
just does something.

So instead of:

Dim Result As Whatever
Result = MyFunction

just

Call MyFunction

I belive that Call is unnecessary when applied to a Sub



"alex" <sql_aid(a)yahoo.com> wrote in message
news:5be8ff29-9922-4b81-8fa7-670cdb705bc3(a)30g2000yqi.googlegroups.com...
On Mar 24, 9:15 am, Stefan Hoffmann <ste...(a)ste5an.de> wrote:
> hi Alex,
>
> Not being John, neither Malkovich...
>
> On 24.03.2010 12:12, alex wrote:> The reason I was getting the error is
> because I was calling the sub
> > like so:
>
> > Call OpenCloseTable "TableName"
>
> > Without 'Call' I don't get an error.
>
> > So...When are you supposed to use 'Call'? (I've always used it!) I
> > couldn't find anything definitive on the net.
>
> When using the Call syntax you need to enclose the parameters in
> parentheses:
>
> Call OpenCloseTable("TableName")
>
> mfG
> --> stefan <--

Thanks Stefan; I'll take your advice anyday!
So there's no functionality difference, only that the Call syntax
requires parentheses (like a function).
alex