Hi everyone,
I am seeing the oddest behavior in the VBA editor when I add a breakpoint in an access function I created. I've been working to simplify the issue down to try and get to root cause, unsuccessfully.
The issue: When I add a breakpoint on a function in VBA, on a sub-query, and I pass any of my table parameters to the function, VBA hangs. It stops on the breakpoint and I can't step through. My table is trival - its a regular table, filled with dates, numbers, and string and has < 10K rows.
That said, the function will allow met to step through at the breakpoint under any of these conditions:
1. If I pass a fixed value (string, null, number, date) it doesn't hang! It works fine. I put the breakpoint and viola, I can step through.
2. If I don't have a breakpoint in the function (just run query normal), even when I pass my parameter, IT WORKS fine. It just runs as expected.
3. And If it's not a sub-query, it works fine;. I can step through the function. I need it to be a sub-query, though so I can select based on a weekending date.
It's only when it's a sub-query, and I pass a field value to the function, it hangs at the breakpoint.
I created the most simple query and function I could think of, and I can't figure out to save my neck. Here's my example:
My function:
public function doNothing(myField)
doNothing = 1
end function
=================================
My query:
SELECT
weekending,
count(*),
(SELECT
avg(doNothing(field1))
FROM myTable as T2
WHERE
T1.weekending = T2.weekending) as testThis
FROM
myTable as T1
GROUP BY
weekEnding;
==================
Again, the VBA editor hangs on the breakpoint only if it is passed the parameter, not a fixed value. And if I have no breakpoint, i get the results back as expected. I've been a programmer forever, and never have seen this.
Anyone ever see it?