Report causes Access crash

S

Shaun

Hi All,

Sorry about the double post, forgot to change the "Discussion Group" the
first time.

I have several reports that are printed in a batch format based on
checkboxes to select records and a 2nd form to select which reports (the code
that batch prints the reports is below). It works fine for 2 out of my 3
reports, but the 3rd one causes Access to crash and restart (no helpful error
msg). The 3rd report is based on the query below (all of the reports are
based on various queries) and is filtered on "[Field_no] = """ &
[Forms]![Site List menu]![Field_No] & """" (all of the reports use this same
filter and have no problems). The report works fine if it is opened in any
other way (filtered or not, directly from the db window or through various
forms). Any clue why doing it this particular way would cause it to crash?
Any help would be greatly appreciated. Thanks -Shaun

**Code for batch print
strWhere = "[Field_no] = """ & [Forms]![Site List menu]![Field_No]
& """"
If [Forms]![Site List menu]![chkSelectRecord] Then
For Each rpt In varReportstoPrint
DoCmd.OpenReport rpt, , , strWhere
Next
End If

**Query for problem report
SELECT Site_boundary.Field_no, Features.*, GPS_Points.Y_Proj,
GPS_Points.X_Proj, GPS_Points.NewID
FROM Site_boundary RIGHT JOIN (GPS_Points RIGHT JOIN (Features LEFT JOIN
lnk_TruSite ON (Features.TRU_Easting=lnk_TruSite.TRU_Easting) AND
(Features.TRU_Northing=lnk_TruSite.TRU_Northing)) ON
CInt(Mid(GPS_Points.GPSId,2))=Features.Field_Number) ON
Site_boundary.Id=lnk_TruSite.SiteID
WHERE (((GPS_Points.GPSId) Like "F*"))
ORDER BY Features.Field_Number;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top