S
Shaun
Hi All,
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;
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;