Results 1 to 8 of 8

Thread: Sub Checking and Calling

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    UK
    Posts
    199

    Sub Checking and Calling

    Is it possible for my module to be able to test whether a sub exists on another form before calling it?

    Thanks in advance

  2. #2

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Originally posted by MartinLiss
    Why would you need to do that?
    Just incase you had memory lapses when coding








    Sorry Paul




    Bruce.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Perhaps you should explain what you're trying to accomplish?

  5. #5
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    PaulTilley


    I don't believe so... But the compiler will.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2000
    Location
    UK
    Posts
    199
    No its not because I have a bad memory.
    No Its not because I have a bad memory.

    Oops...

    NE Way, its because from a module I need to call a sub on a form. There are many forms with the same sub name within. Some forms do not have this sub at all, and this is what I need to test.

    Your comments have made me realise though, that there is another better way of approaching this problem.

    Im about to check it out now.

    Ta all.

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by PaulTilley
    No its not because I have a bad memory.
    No Its not because I have a bad memory.

    Oops...

    NE Way, its because from a module I need to call a sub on a form. There are many forms with the same sub name within. Some forms do not have this sub at all, and this is what I need to test.

    Your comments have made me realise though, that there is another better way of approaching this problem.

    Im about to check it out now.

    Ta all.
    Calling a form's sub from a module. *sounds* a little inefficient to me, and I'm sure there's a more optimized way of doing the same.

    But anyways, you can delcare the sub as public, and call it like

    Form3.SubName()

    HTH

  8. #8
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    He mendhak, Who kissed you.... No that's all wrong... Kiss a frog it turns into a Prince

    Good looking Avatar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width