
Compilation error expected =
Hi Ulrik,
If you use brackets then a return value
is expected. Lose the brackets and you'll
be okay.
As an example, take the native MsgBox function.
If you use it like so:
MsgBox "Hi"
you do not use brackets because you're not
returning a value.
If you use it like:
Response = MsgBox("Do you want to do this?",vbOkCancel)
Then you need brackets.
HTH
Dan
Quote:
> Hello,
> I've written a function with three variables:
> Function FunctionName(Var1 As String, Var2 As Single, Var3 As Single)
> I try to call this function from a form's event, but I keep getting the
> 'compilation error, = expected' message, when I write
> FunctionName(Name,1,3). If I skip the ,1,3 all together there's no
> compilation error message (ofcourse the function won't work then). It's
> meant to send a prewritten e-mail...
> What can be wrong? I have another function with the same variables, which
> dosen't give me problems, but this other function returns a single, so....
> Thanks
> Ulrik
> --------------------------------
> "I'm not a vegetarian because I love animals. I'm a vegetarian because I
> hate plants."
> A. Whitney Brown