Calling a procedure using a variable name 
Author Message
 Calling a procedure using a variable name

I need to call a procedure in a form. Using the " Call
Forms!xxx.Btn_Click()" constuct works but I need to be able to specify both
the form and the button as variables.

I need something like the following :

    tmp_form = "xxx"
    tmp_button="Btn"

and then

     Run / Docmd "Call Forms!" & tmp_form & "." & tmp_button & "_Click()"

Is there any way I can get something similar to work under vba.

tia
Neville



Sat, 13 Sep 2003 12:47:17 GMT  
 Calling a procedure using a variable name
Hi,

Try looking at the Eval Function...

On Tue, 27 Mar 2001 14:47:17 +1000, "Neville Satz"

Quote:

>I need to call a procedure in a form. Using the " Call
>Forms!xxx.Btn_Click()" constuct works but I need to be able to specify both
>the form and the button as variables.

>I need something like the following :

>    tmp_form = "xxx"
>    tmp_button="Btn"

>and then

>     Run / Docmd "Call Forms!" & tmp_form & "." & tmp_button & "_Click()"

>Is there any way I can get something similar to work under vba.

>tia
>Neville

---------
Pedro Gil
http://www.geocities.com/pmpg98_pt

DDPI
http://www.users.bigpond.com/papwalker/DDPI.HTML
https://sourceforge.net/projects/ddpi/



Fri, 12 Sep 2003 19:14:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Calling a sub procedure whose name is in a variable: call me.ProcToRun

2. Procedure call with name as a variable?

3. Help Using Variable To Call a Procedure or function

4. call procedures in a Subform using variables

5. call procedure using variable

6. Call a procedure using a variable (for nightly jobs)

7. referencing a local variable in the calling procedure from a nested procedure

8. Help with using names and variables in a function call

9. Call Let/Get Prop using string variable for name

10. Call Let/Get Prop using string variable for name


 
Powered by phpBB® Forum Software © phpBB Group