Page 1 of 3 123 LastLast
Results 1 to 15 of 35
  1. #1
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941

    Unanswered: Code doesn't execute

    I have an unbound form, with a few input controls and a few command buttons. Sometimes, the code behind the command buttons doesn't fire.
    The form just sits there. I can still type values in, or select values from a combo box, but the code seems to be hung. This can be very irritating to my users when one of the command buttons is the "Exit" button, and that's their only way out of the form.

    Any thoughts?
    Inspiration Through Fermentation

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    What version? If 2007, note here about the trust center:

    http://allenbrowne.com/Access2007.html#Configuration
    Paul

  3. #3
    Join Date
    May 2004
    Posts
    159
    Quote Originally Posted by RedNeckGeek
    I have an unbound form, with a few input controls and a few command buttons. Sometimes, the code behind the command buttons doesn't fire.
    The form just sits there. I can still type values in, or select values from a combo box, but the code seems to be hung. This can be very irritating to my users when one of the command buttons is the "Exit" button, and that's their only way out of the form.

    Any thoughts?
    Just a thought but be sure you have the correct click event chosen for running the code. Post the code the command runs and we can help you more.

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Using Office XP.

    I think I left out a "minor" detail...
    This problem is sporadic. Most of the time, the code on the form
    works just fine. As matter of fact, it may work once on that PC,
    and the next time the user opens that form, it doesn't work.

    I've noticed this on and off for several years, and have never been able to
    track it down. It's not just limited to one pc or just one form. I have error traps everywhere, and nothing ends up in my error log.
    Inspiration Through Fermentation

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Quote Originally Posted by RedNeckGeek
    Sometimes, the code behind the command buttons doesn't fire.
    I've only noticed this speriotically happening when I didn't debug-compile the code or if I had some functions duplicated named. I've never found it happening if the mdb was debugged and compiled and didn't have any functions named the same name.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    hmmmm.... that's interesting.

    I know the user just copied a new "version" today, and that version was compiled yesterday when I put it out on the network.

    But - most of my forms have a sub named "btnExit_OnClick" and/or a function named "SaveForm". That could be a problem, then?
    Inspiration Through Fermentation

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    function or subs? I usually try to keep all my functions named slightly different but I have lots of subs named the same in different forms (i.e. Private Sub cmdCloseForm_Click()).

    It would be interesting to see though if when a button doesn't work if the mdb is debugged/compiled. My bet would be that it probably isn't but I wouldn't stake my life on it.
    Last edited by pkstormy; 12-10-07 at 18:26.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    mdb or mde?

  9. #9
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Hmmm

    2 things :
    See-ing that you say you copied to network and user starts up a network copie.
    1.
    Do the user all have different user-logins and rights and/or more important different setup image and/or type PC.

    If so look at who has the problem on wich pc.
    Can be diff in dll are being loaded

    2. if same user start up the app. on same pc and sometimes that person has and hasn't got the problem (had it once that the code didnt recognize LEFT function on 1 monday morning) see if all add-ins are loaded and reboot PC

  10. #10
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    The process goes something like:

    I keep a master copy of the <b>mdb</b> on my pc. I'll make some changes,
    compile, and then compact. Then I copy it to a network location, and notify all users to pick up the copy. They then copy from the network to their pc's
    (using a batch file), and run a local copy.

    The next time it happens on a pc that's close by, I'll go out and see what the compile state is on that pc.

    Thanks for the help!
    Inspiration Through Fermentation

  11. #11
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I've had this problem with mdbs but not mdes. There are plenty of other reasons I prefer mdes too. Any reason you are using an mdb?

  12. #12
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Quote Originally Posted by pootle flump
    I've had this problem with mdbs but not mdes. There are plenty of other reasons I prefer mdes too. Any reason you are using an mdb?
    I guess I hadn't thought about it. Never used mdes before. Once I'm finished working the kinks out of the system, I suppose I could try to convert it.
    Inspiration Through Fermentation

  13. #13
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    It's not a matter of converting - just click Tools -> Database Utilities -> Make MDE File and vwa la! It is the Access equivalent of creating an EXE. You keep the mdb and work on it, the users get the mde.

  14. #14
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    I'm guessing the change is transparent to the users? I don't want to throw them a curve ball at this point.
    Inspiration Through Fermentation

  15. #15
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Nope. Different extension for starters. Depends how much they like to fiddle about under the covers too.

    Make one and play with it - defo test before you throw it out there. In particular, note that you cannot access (nor, by extension, change) code or forms & reports in design view.

Posting Permissions

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