Check if a sub exists

the master
01-03-2008, 12:56 AM
Hi. Is there a way to check if a sub exists in another form? I want to run a sub "form2.dosomething" from form1 but form2 might not have a sub called "dosomething". If it doesnt then i want it to ignore it. I would also like to do it without an error handler.

I know it sounds daft but im loading multiple instances of forms which have to access a sub in the "owner form" which could be any other form

DougT
01-03-2008, 01:12 AM
Isn't that what Modules are for?

the master
01-03-2008, 02:14 AM
Sorry i dont get you.

I have some forms which have a variable that stores the "parent form". When they unload the have to run a sub in the parent form but some parent forms dont have the sub

mkaras
01-03-2008, 07:51 AM
Sometimes the obvious thing escapes us!

Why not simply go through all your possible "parent forms" and add a common element to all of them. This could be a wrapper function that reports back if that specific form has the subroutine in question or not. Seems simple enough.

the master
01-03-2008, 10:10 AM
I could add the sub i want to every form but i was hoping not to do that

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum