how to call a sub which is a database record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi
Can i put different public subrountines in a modules and run it by thorugh
forms but that name is stored in a table?

e.g.
In module:

public sub A()
msgbox("A")
end sub

public sub B()
debug.print("B")
end sub



in table:
<name> <subroutine_to_Run>
peter A
Mary B


in forms: i set text box refer to the value in sub form in order to get
Private Sub cmd_runquery_Click()
Call Me.txtSubroutineToRun
end sub


however, i get error message..
seems "call" doesnt' work on db records
should i need to use docmd.runmacro ? but i don't want to use macro as
coding get more flexibilities

thanks
 
Should be able, can't see why you would want to though. You'd use
DLookup() or another means to grab the function from the table and then
an eval() statement to build the function name as in

Call Eval(Dlookup())
 
Back
Top