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

Passing a procedure as a parameter?

Status
Not open for further replies.

Petemush

Technical User
Jun 21, 2002
255
GB
Hi,

I'm currently calling a procedure from several different events. In this procedure I want to call another procedure. The procedure to be called depends on the event that called the current procedure. I thought I could just pass a procedure to be called as a parameter but I don't know what to set the argument as.

Ie.

Private Sub After_Travel_Hotel_CheckBoxes(checkName As CheckBox, _
upperCheckName As CheckBox, _
procedure As ?Procedure?)

How do I do this?

Cheers,

Pete
 
i would suggest some thing like this...

Private Sub After_Travel_Hotel_CheckBoxes(checkName As CheckBox, upperCheckName As CheckBox, procedure As string)

if procedure = "proc1" then
proc1
end if
if procedure = "proc2" then
proc2
end if

exit sub

i think this will work for you, just one note... If you have alot of different (as i called them) proc's, you can use a case statement, it'll make the code much neater for more then 2 possable proc's...

--James junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top