Results 1 to 9 of 9

Thread: Add code to all Forms

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Location
    Surrey, England
    Posts
    17

    Question Add code to all Forms

    I have a large application which contains many hundreds of forms. I need to add a set piece of code to a particular procedure on every form in the system. Does any one know of a quick and neat way that I can copy the code to all the forms without me having to do it manually

  2. #2
    Si_the_geek
    Guest
    put the code in a module, then all the forms can access it

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by Si_the_geek
    put the code in a module, then all the forms can access it
    he still have to do it manually

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Peet is right. Order some pizza and call all your friends over. Its going to be a lot of work.

  5. #5
    Addicted Member Bregalad's Avatar
    Join Date
    Jul 2000
    Location
    Oslo,Norway
    Posts
    183
    You could make an Add-in that loops through all the
    forms in your project and adds the code in each.
    Add-ins aren't too hard to make, and when you get
    used to making them, there are lots of things you
    can do to automate your programming.

  6. #6
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    nono what Hack is trying to say is "Order some pizza and call Peet and Hack over... we will help u ... eating all that pizza"

  7. #7
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    Couldn't you just loop through all the .frm file and open then for input one at a time. Do a line input and until you find the procedure you need. Add your piece of code and move on to the next form.

  8. #8
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Maybe i am crazier than a coconut but could u use a little proggie to open up all the forms as text files, add the new routine and then save them..??? I posted something like this before for html files... any reason it wouldnt work for .frm files??
    Regards
    Stuart

    http://www.vbforums.com/showthread.p...ghlight=parser
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  9. #9
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Originally posted by beachbum
    Maybe i am crazier than a coconut ...
    you are

    nevertheless its the solution.. sorry for all my stoopid comments...

    *thngfphft* <- peet putting his foot where it belongs

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