I have a report based on a query which has no criteria to filter on. Instead, the user makes all the criteria selections on a form. When the user clicks the Preview button on the form, an SQL string is built and passed as the strLinkCriteria argument of the OpenReport command. It has been working fine for months…but then! All of a sudden, one criteria value started causing the report to freeze while it is formatting. It seems to go into an endless loop somewhere. The Status bar indicates the the query has run and the report is formatted, but when the Progress bar reaches 100%, it stops there! I have to press Ctl + Break to break out.
It so happens that the strLinkCriteria string looks like this when it fails:
[Sub_CA ]= ‘AR’ That’s it! Nothing earth-shattering in that string! No other criteria selected.
Oh, by the way, this DOES work… [Sub_CA ]= ‘CT’
And so does this: [Sub_CA ]= ‘cks’, and so on…
Only the initials ‘AR’ seem to cause a problem.
I can run the underlying query the ‘AR’ criteria entered and it returns 46 records.
If I save the query with that criteria, and run the report manually, (without the filter), it still fails. Yet, I CAN do these same steps with other initials as criteria and it works fine.
More information:
-The [Sub_CA] field is a hidden control on the report
-It is located in one of 4 group headers
-It is NOT the field being grouped by
I can’t seem to find anything different between the records that have ‘AR’ values and all other values.
I look forward to an enlightening, an probably Humbling, solution. (Other than having to fire this girl [A.R.])
While I am waiting, I will begin reading my Access for Dummies book again. Must have missed a paragraph….
Thanks,
Rich P