Joop said:
In an application that I developed the VB-code sometimes
stops executing as if there was a breakpoint. The code is
started by clicking a button. It stops at the first line
of the procedure, the codeline is marked yellow. When I
hit the continue button the code runs on normally.
Has anybody an idea how to fix it??
Hi Joop. I suspect that somehow you've saved a break point without
meaning to. This has happened to me before. It seems unlikely IMO that
Sng1 being Null should have an effect like breaking code. Do you recall
having a break point on that first line at any point while writing the
proc? If so, what you probably did is save the routine before you
removed the break point.
I have two suggestions for solving this problem, if this is what it is.
One has worked for me and the other is a guess. The guess-solution is
easier/less risky. Try setting a break point on that line, and then
removing it, and then save the routine, and see if the problem goes
away. If you try this please post back to let me know if it works
because I've never tried it.
The solution I've used before is to decompile your database. This is a
somewhat risky endeavor, and you shouldn't try it on your only copy of
your db. It's an undocumented command IIRC. To do:
0) If you have a form set to open automatically when the db opens, go
into Tools->Startup and set the opening form to None.
1) MAKE A BACK UP OF YOUR DB. REALLY. NO FOOLING.
2) DON'T EVEN READ THE REST OF THIS POST UNTIL YOU'VE BACKED UP YOUR DB.
3) Create a shortcut to your db.
4) Open the properties sheet of the new shortcut.
5) Type " /decompile" at the end of the string in the Target box. Note
that's a space, and "/decompile".
6) Close shortcut property sheet. Double-click shortcut to open
database. If you're not using default security, you'll need to log in
as a user with Admin rights (I think).
7) After you've opened the database, open the VB window and go to the
Debug Menu->Compile option, and click it to re-compile your code. Now
you can reset your startup form, if you had one.
If you try this, let me know if it works for you.
HTH
spark