Skipping Some queries and conditions
-
Hello friends, I am struck with a bug in my code and find it difficult to debug. In my MS access application, I am creating some reports using SQL queries to fetch data from Access Table and SQL table. Some time the code works fine, creating the report fine. Some time its not creating the report fully, skipping some queries and conditions. If I try to run the code using 'Step in', the report always creating as expected. if it run otherwise report fails. I tried using with delays, then its working fine. But I have to use min 5 sec delay for that. So its effecting the performance. I dont have much experience in VBA and SQL queries. IS it due to some error in my code or something else? Thanks and regards Jishith
-
Hello friends, I am struck with a bug in my code and find it difficult to debug. In my MS access application, I am creating some reports using SQL queries to fetch data from Access Table and SQL table. Some time the code works fine, creating the report fine. Some time its not creating the report fully, skipping some queries and conditions. If I try to run the code using 'Step in', the report always creating as expected. if it run otherwise report fails. I tried using with delays, then its working fine. But I have to use min 5 sec delay for that. So its effecting the performance. I dont have much experience in VBA and SQL queries. IS it due to some error in my code or something else? Thanks and regards Jishith
Without seeing the code, it's impossible to say. Even then, with it may be difficult. If sections of code are being skipped, it sounds like you have a design problem or you're catching and eating errors with On Error Resumt Next, without checking the Err object at various stages to see if an error occured before continuing.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Without seeing the code, it's impossible to say. Even then, with it may be difficult. If sections of code are being skipped, it sounds like you have a design problem or you're catching and eating errors with On Error Resumt Next, without checking the Err object at various stages to see if an error occured before continuing.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
The code works always fine with single steppings. When at full running , the problem occurs.. If i putting any break point inside the code, 80% times run properly... And i am not using On Error Resume Next in this function.
Then you're going to have to put some tracing code in there to see what variables have what values at various points in your code. Log this information to a file and review it when the problem occurs.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008