On Sun, 18 Jan 2004 01:14:07 +0100, "Jon Ole Hedne"
<jo*****@online.no> wrote:
Oh, yes it does.
Think about it. You're saying that the Eval function "only" returns
the value of another function. How do you think it computes the return
value? Of course by running that function!
Eval works only with functions, not with subs. Rewrite your subs as
functions.
Debug.Print Eval("MyFunction()")
-Tom.
I have now. The Eval-function returns only the value of another function, it
doesn't actually run the function (or sub). One procedure could be something
like this:
Public Sub Etiketter()
Docmd.runSql "Select something..."
DoCmd.OpenForm "TheForm", acNormal
End Sub
Public Sub RunOnClick()
rs.open, mytable, conn
call rs!function_name (Which contains "Etiketter" Or "Etiketter()" Or
Etiketter) The SQL should execute and the form should open....
Exit sub
Jon Ole
"Tom van Stiphout" <to*****@no.spam.cox.net> wrote in message
news:rg********************************@4ax.com.. . On Sat, 17 Jan 2004 21:48:40 +0100, "Jon Ole Hedne"
<jo*****@online.no> wrote:
Check out the Eval function in the Help file.
-Tom.
>I have a possibly stupid question - thought it was simple to do....
>
>From vba code I want to call a sub or function. The name of thesub/function >is stored in a table. I want to achieve something like this:
>
>....
>rs.open, mytable, conn
>'Here is the problem-line:
>call rs!function_name
>'And here should the sub/function run...
>
>Probably I have to declare a variable, set its name to the function nameand >execute the variable, but I can't figure it out...
>
>Thanks :-)
>
>Jon Ole Hedne
>Norway
>