IsNull strange problem

P

PeterW

I have just made some changes to a database where I am using the after update
property of a calendar to trigger changes.
When I first open the database and change the date the code acts as if a
breakpoint has been set at the reference to IsNull. If I step through the
code all works ok and then everything works fine. I can then alter the dates
and everything will work fine every time.
I could post the code but it is quite long.
I would be greatful for any advice if anyone has seen this before
 
P

PeterW

I think I found the answer - I found info on ghost breakpoints and by adding
a space before the IsNull reference and then saving it seems to have cleared
the problem. Would this make sense?
 
D

Dirk Goldgar

PeterW said:
I think I found the answer - I found info on ghost breakpoints and
by adding a space before the IsNull reference and then saving it
seems to have cleared the problem. Would this make sense?

Generally, when I find phantom breakpoints, the first thing I do is make
some inconsequential change to the code, then change it back, save it,
and recompile. Most often, that fixes it.

Did you by any chance modify your code while running it in break mode?
That's been known to cause phantom breakpoints and, occasionally, code
corruption.
 
M

Marshall Barton

Ghost breakpoints are a symptom of a corruption in the
compiled code or that Access is confused about whether it
should use the edited or unedited version of your code.
Whatever the reason, it's not a good sign and you should
make a backup in case it gets worse. Then using Decompile
to dump all the compiled stuff
http://www.granite.ab.ca/access/decompile.htm

Your trivial modification of a line of code can shake things
up to get the VBA processing sorted out or it can make
things worse.

The common cause for this kind of confusion is editing a
form/report's module when the form/report is open in any
view except Design View. It's a difficult habit to
establish, but you should ***always*** switch to design view
before editing any form/report's code. This means that you
should never edit any code while in a breakpoint.
 
Top