Debug

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I have a piece of code that opens a recordset and adds records to a table
for any events that exceed 1 day in duration. It makes an exact copy of the
data and increases the date one day at a time until end of duration eg if
ReviewDays = 4 and the ReviewDate is 01/01/05 it will create 3 extra records
for the 02, 03 and 04 Jan 05.

For some reason this does not appear to be working correctly, its added an
incorrect date record for one of the staff. I suspect it might be something
to do with how its interpreting dates but its odd as all records seem to be
correct apart from this one oddball.

I want to debug the code to try and figure out where it goes wrong. The
staff member (specialist) is ID 18 - is there a way I can get the code to run
until it hits this specialist so I can then step through the code from there?
I tried putting a msgbox if specid = 18 but this didn't allow me to debug the
code.

Thanks
Sue
 
while you are in debug, select Add a Watch. In your watch expression, enter
SpecID = 18
Then select Break When True
 
Easy when you know how :-)

Thanks...

Klatuu said:
while you are in debug, select Add a Watch. In your watch expression, enter
SpecID = 18
Then select Break When True
 
The message box approach should work too. When it appears, hit the Ctrl +
Break keys rather than the OK button and you should be taken to the VBE with
the current line highlighted. Then you can start stepping through.

HTH,
 
Back
Top