Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Using Application.Eval 1

Status
Not open for further replies.

6kleg

IS-IT--Management
Dec 21, 2004
24
US
Trying to use Application.Eval in Access 2000 to call a function with the function name in a variable. The procedure gets the name of the function to call and its 3 arguments from a recordset. The argument for Application.Eval is put in a string called call_string
Code:
call_string = rst![ActionProcedure] & " ('" & rst![Arg1] & "'), ('" & rst![Arg2] & "'), ('" & rst![Arg3] & "')"

Application.Eval call_string
In Debug, the variable call_string evaluates to
"fMy_function ('MyArg1'), ('MyArg2'), ('MyArg3')" as desired but I get Error '2439' "The expression you entered has a function containing the wrong number of arguments"

The function being called starts with:

Code:
Function fMy_function (arg1_in As String, arg2_in As String, arg3_in As String)

Any clues as to what's happening here?
 
The string should only have two parens shouldn't it?

[tt]"fMy_function('MyArg1','MyArg2','MyArg3')"[/tt]

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
VBSLammer,

Right you are. You posed that as a question but you already knew the answer. I should have been able to figure that out myself.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top