Unanswered: Access 2002 quits unexpectedly on openreport
I have a problem with Access 2002 (on fully patched XP Pro) where opening report via code below sometimes causes Access to quit directly without any warning or error messages. Nothing written to event log.
Code as below;
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptWorkLam"
stLinkCriteria = "([boats.MouldNo] = " & Chr(39) & Me!txtMouldNo & Chr(39) & ") AND ([invcategoryname] = " & Chr(39) & Me!txtInvCatName & Chr(39) & ")"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
Code has been utilised sucessfully for some months on various machines and has suddenly started failing on this openreport command - it is the where condition causing it, as the report happily and reliably opens without the where string or with one or other of the criteria, but not both together when failing. Have tried many combinations of the where string - a msgbox showing the string always has the correct data for the where string. I successfully use this type of string elsewhere without intermittent failure.
Openreport failure is not reliably evident on all machines using this front-end application to back-end dataset. Failure seems to be unreliable - one day a particular machine will extract the report correctly, the next Access will quit unexpectedly on running this report. A standalone machine exhibits same symptoms when failing as a production networked machine.
Have compacted and repaired to no avail. Have also created new front-end mdb and imported from old front-end and then relinked to tables in back-end dataset in attempt to raise/clear issues. Even setting break on all errors does not raise an error dialog or trip my error handling routines - it just quits Access immediately and directly to the desktop.
Am going to import backend dataset to new 2002 mdb and see if there are any issues there. Have currently changed code for production front-end to utilise one criteria only.
Does anyone on the forum have suggestions for a way forward?
Yes, does fail on standlone - even with front and back ends at same version of db (XP Pro, Access 2002) in newly created mdb's. No other programs running. Really odd.
Data is happily extracted for report with no where condition or with one or the other of the two conditions, so data volume does not appear to be an issue. Only becomes unreliable and fails when the two conditions are applied together.