Weird problems with VBA in Access

G

Guest

Hi,

I am having some strange difficulties with some VBA code written in Access.
The code was originally written in Access 97, where it works fine. Since
then I have been using the same code in Access 2000 and 2002, but for large
datasets the code will inexplicably just stop. There is no error message or
anything, it just stops processing after it reaches a certain number of
records. I can identify where in the dataset the code stopped from the
output, but when I run the code using the debugger to that point, there is no
identifiable error. That is, I can step through the point where code stopped
with no problems and keep on going, as long as I am in the debugger. It only
kicks out of the routine when I am runnning it outside the debugger.

Any ideas? I'm hoping someone else has had a similar problem when
transferring VBA code written in Access 97 to later versions.

Thanks!

Tom
 
M

Margaret Bartley

This sounds like it might be a corruption issue. I've had invisible
corruption issues before.

You should rebuild the table with the offending data. Do an Append Query to
move every record to the new table, rather than copy the table from one DB
to another.

One way to decide if it's a corruption issue is to resort the input data,
and see if it stops with the same record, or at the same recordcount.
 
G

George Nicholson

You might consider adding a "Do Events". (maybe have it excecute every 10th
time through the loop). Depending on the program, what you're asking it to
do and the hardware it's running on a "Do Events" can help to let all the
pieces get back on the same page.

Not a particularly elegant suggestion, but I've had it work too many times
when nothing else seemed to.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top