Pass Method?

I know it sound weird, but is it possible to pass a Method as a parameter to another method? I want to create a generic method that performs a generic task, then a specific task then actions the result generically. If I could pass through the specific method as a parameter then I could place the lot in one lump of code.

I have tried to create a method that receives myMethod As Method as a parameter, but it fails when compiled!

You can’t directly pass a method, but you can define a Delegate and pass this, I guess.
Try consulting the help for Delegate

Thanks, I’ll give Delegate a try.

Massimo beat me to it. :slight_smile:

Actually, David, are you coming from C language?
At least this seems to me a very C-like approach (which is very useful sometimes, I also used it).
It depends on how your project is organized, but keep in mind you can achieve a similar result using Class Interfaces in some cases.

No, not a C-type query. I am have created a generic WE reporting WebPage that takes the results of a database query and builds a report, offers sort options, printing to PDF, export to XLS/CSV/Tab, etc plus field-by-field searching. My problem is that many reports are more complex than a single SELECT lookup, so I build them in a Method first then pass on the results. I was hoping that if a user wanted to filter the results from a complex report I could run the original method (passed as a Method/Delegate), then filter the new results.