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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run a function depending on situation

Status
Not open for further replies.

sixtoedsloth

IS-IT--Management
Jan 1, 2002
118
GB
HI,

im not sure if this is possible....


i want to store in a databse the name of a function
that is to be run. when the user logs in the code looks in the database for that user, retrieves the function name and runs it. any ideas how to do this?

Cheers

Russ
 
There is the "CallByName" function that executes a method or property of an object (check VB help for that.) I would however be somewhat leery about storing actual internal Sub or Function names in a database. If you do, you now become bound to database contents when maintaining your application. I would look into a case statement that allows you to associate a value in the database with a specific function or sub. Something like
Code:
Select Case [ActionField]
   Case "Save"
      Value = FuncSave (Parm1, Parm2, ...)
   Case "Compute"
      Value = FuncComp1 (Parm3, Parm4, ...)
etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top