Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple Instances of Form w/Timer Event (Access 2002)

    We have a requirement to look for files with specific file names in a specific folder. We have set up a form with a timer event to look for the presence of one such file every 5 seconds. This works with no problem. However, we need to open multiple instances of this form, each looking for a different file name.

    Problem: When the second instance is opened, it closes immediately, with no message or anything. It simply disappears.

    Is there a restriction on more than one instance of such a form being open? If so, what other strategies can we employ to achieve the desired goal?

    Thanks.
    Carol W.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple Instances of Form w/Timer Event (Access 2002)

    I do not know the answer to your specific question, but it isn't clear to me why you need to open several instances of the same form. Is there a reason that this one form cannot look for all the files that you need in their associated folders? Or a reason you do not use different forms rather than multiple instances of the same form?

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple Instances of Form w/Timer Event (Access 2002)

    Thanks for the reply.

    This is the first experience that we have with the Timer event. If it turns out that only one instance of the form can be open, I guess it will be "back to the drawing board". We may be able to set up a table containing the file names that we are looking for and constantly loop through the contents of that table. Once we find the file, we can delete the corresponding entry from the table.

    Any other suggestions? Thanks.
    Carol W.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multiple Instances of Form w/Timer Event (Access 2002)

    Like Thomas I'm baffled by what you're trying to do. It is not necessary or even desireable to have multiple instances of a form monitoring for different files. You just need one form looking for any of the files in question. It is possible to open multiple instances of a form through automation, but there isn't any reason to do so for something like this. Just capture the files you want to check for, either in a table or on a form, and then have your timer-form check for each file. Without more explanation of what you're trying to accomplish, it isn't possible to suggest better alternatives.
    Charlotte

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple Instances of Form w/Timer Event (Access 2002)

    Thanks for the reply.

    Our app will be looking for multiple text files, with specific names, that will be periodically placed in a specific folder by another, third party application. Our original thought was to open multiple instances of an "interrogator" form, each form with the timer event turned on, looking for a specific file.

    It now appears that a better solution would be to store the file names in a table, open one form (when the first entry is placed in the table) that looks for each file name in the table in the timer event, and then delete the file name from the table once it is found. We will recode our app on that basis unless someone has a better idea.

    We're open to any other suggestions. Thanks.
    Carol W.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multiple Instances of Form w/Timer Event (Access 2002)

    I don't really understand what you're doing with the files to be placed in the specific folder. Are you checking for all the files that are placed in that folder or only to see if specific files have been placed there? Are you doing something special when those files arrive in that folder? If you're looking for the same file names again in the future, then deleting those filenames from a table doesn't seem to make a lot of sense. If you have a standard list of file names to look for, by all means store that in a table. Then create another table that stores the names of the files received and some kind of date stamp. When you find a match, you can put a record in the second file to show you found a match and did whatever it is you're supposed to do under those circumstances.
    Charlotte

  7. #7
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple Instances of Form w/Timer Event (Access 2002)

    The application is a credit card authorization program. We send a request out and the files we are looking for are responses to that request. The files all have unique names. There should never be two with the same filename.

    We need to see when a specific file arrives and process it according to transaction type. I think that the scheme that I outlined in my previous post should work. Once the file is detected by our app and processed, we don't need it anymore. So deleting it from the "pending files" table should work. We are coding that now.

    Thanks.
    Carol W.

Posting Permissions

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