Results 1 to 14 of 14
  1. #1
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    Kent, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Module deletes itself (A2k)

    I have a database with a macro to run some very basic queries. I used the analyzer to pick up suggestions on how to improve my database. One of the things it suggested was converting my macro to a module which i did (TOOLS / MACRO / CONVERT TO VISUAL BASIC).

    I ran the module & it did everything it was supposed to do - and then deleted itself!!!!!!

    Any takers?

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Module deletes itself (A2k)

    When did it delete itself? Immediately? At any point in time could you hit the Save button on toolbar?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2001
    Location
    Kent, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Module deletes itself (A2k)

    Before this, I had never run any VBA in Access. initially I tried to double click the module, but nothing happened. So, I opened the code in Design view and run it from there. After it finshed, I closed the VBA editor & the module was no longer there.

    99% sure that I didn't hit save at any time (or any other buttons)

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

    Re: Module deletes itself (A2k)

    You double clicked a module and nothing happened? It should have taken you straight into the VBE and the design view of that module. If you saw the module in the modules tab in the database window, then it should still be there unless you added a new one and clicked No when asked if you wanted to save changes to Module Whatever.
    Charlotte

  5. #5
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Module deletes itself (A2k)

    I'm not that familiar with A2000, but it seems to me that if a module is open, it doesn't show in the module tab of database window. Try exiting database completely and see what happens next time you get back in.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Module deletes itself (A2k)

    Actually, any saved modules show in the database window, open or not. It's only new modules inserted from the VBE that don't show in the database window until they've been saved. That either happens when you save the project or when you shutdown the database and it asks you is you want to save changes to Module Whatever.
    Charlotte

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Module deletes itself (A2k)

    In one of my few forays into A2000, it seems I had some problems with a module getting "lost". But I can't remember the exact circumstances, although I didn't think it was a new module, but one I'd copied in. But I can't remember the details, only that I was frustrated for awhile!
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Module deletes itself (A2k)

    The only thing I've encountered is with forms whose HasModule property is set to Yes but where the module has never been opened. Those don't show up in the project. Otherwise, I've had no problems with "missing" modules. Oh, and if you import a file into the VBE project, it doesn't show up in the database window until you've saved the project.
    Charlotte

  9. #9
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Module deletes itself (A2k)

    >>The only thing I've encountered is with forms whose HasModule property is set to Yes but where the module has never been opened. Those don't show up in the project. <<

    That might have been it. I just remember I couldn't find it for awhile, I think until I closed-out and came back in. At least next time I'll know what to look for. Thanks.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  10. #10
    New Lounger
    Join Date
    Jan 2001
    Location
    Vermont
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Module deletes itself (A2k)

    Actually, I had a behavior similar to this just yesterday in Access 2000 - the module associated with one of my forms disappeared. Clicking on an event property and selecting "Code builder" would not bring up the VBE, and hitting the "Code" button on the tool bar also had no effect, nor did closing and re-opening Access or even rebooting Windows.

    I finally started with a blank database and imported all the objects I needed except the haunted form; that I recreated. I'm much happier that this happened on day 3 of the project rather than day 30...

    I noticed that Name Autocorrect had been on and turned it off and things have been behaving better since then. Don't know if it's related, but it sounded similar...

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

    Re: Module deletes itself (A2k)

    Name Autocorrect is on by default in any new database and it's been identified as the culprit in all kinds of odd behavior in Access, so turning it off could very well have been the cure you needed.
    Charlotte

  12. #12
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Module deletes itself (A2k)

    There seems to be too much of this sort of thing that happens in A2000. It just doesn't seem to be developer friendly! But it is getting to the point where I am going to have to bite the bullet and upgrade.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Module deletes itself (A2k)

    I haven't found that to be the case, Mark. I like Access 2000, although I learned right off to turn off Name Autocorrect and kill those nasty subdatasheets. With those out of the way, I've had few problems with it.
    Charlotte

  14. #14
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Module deletes itself (A2k)

    Like anything else, it depends on what you are used to. Just using A2000 periodically means I don't get used to how it does things, so for me it is annoying.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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