Marc,
I was able to show my IT staff today that by changing the value to null from any valid code number (0 is the code for a blank part number) it immediately caused an access violation when I clicked the "Refresh lookups" button. Changing it back to 0 removed the problem and the form works as expected. It looks like the failed where clause on the variable lookup listview (no rows found) was the culprit (still double checking and testing this theory). Most of the time, my listviews look at a temporary tables with freshly populated data without a where clause. These work great and I use them everywhere. The reason it was so hard to find is that I call another routine from this complex form that would only SOMETIMES return a null. Scrubbing the code in the main form over and over did not locate the problem, it was in another form/routine that we call that changed the value of a variable. Because of this, it appeared random, but after I found the cause of this problem, I can easily cause an access violation at will. Better code solved the problem. I have also tried to trap for errors, but neither the error variable or the sqlcode variable was triggered. I found which line of code triggered the AV by putting in "pause 2 using 'I made it to here #1" and "pause 2 using 'I made it to here #2" etc. But even though this line of code was not the problem and works properly now without change, it lead me in a direction to find what was wrong with the form. After the AV message appeared, the 2nd pause 2 did not execute. Kenny From: [email protected] [mailto:[email protected]] On Behalf Of MDRD Sent: Tuesday, August 31, 2010 7:22 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: Solved: Access Violations Kenny Does it choke every time? I get occasional AV errors but they seem to be random and most of the time when I am Exiting my APP. I have a block of code that traps the last 3 errors that I run after each menu choice to try to pin point errors in my code but nothing seems to show up. Thanks Marc -------------------------------------------------- From: "Kenny Camp" <[email protected]> Sent: Monday, August 30, 2010 6:21 PM To: "RBASE-L Mailing List" <[email protected]> Subject: [RBASE-L] - Solved: Access Violations > I found an issue that was causing access violations, and yes it was very > hard to find. > > A variable lookup listview, located on a enhanced tab control, with a where > clause (where scn = .vscn) would choke when the variable vscn was set to > null. > > When I set it to 0 (a valid lookup) the access violations stopped, a null > would fail the lookup. > > Normally this var is set to 0, but I added a form that sometimes set it to a > null and then returned to the previous form and AVs started. > > There may be other contributing factors, so I will test further and report > to RBTI. I hope this helps someone else. > > Kenny Camp > >

