< If I understand correctly, you can use the selected sites to build a
where
< clause like:
< "[Site] In ('sitea','siteb','sitec','siter')"
< Use this as the where clause to open a report.
Duane
I'm not sure what you mean, but I enclose further info regarding the query
and form as it stands.
Please elaborate further. I know a little Access and a little VBA. If I
can't work this out, then I will definitely learn from it.
My query is as follows:
SELECT SurveyData.[Date of Survey], SurveyData.Site, SurveyData.Element,
SurveyData.Condition, SurveyData.PriorityRef, SurveyData.[Revenue Cost],
SurveyData.[Revenue Comments], SurveyData.[Remaining Life],
SurveyData.[Capital Cost], SurveyData.[Capital Comments]
FROM SurveyData
ORDER BY SurveyData.[Date of Survey], SurveyData.Site, SurveyData.Element;
This basically selects everything, unless I add a Like[] statement to the
Site field.
My form preview/print code is as follows:
Private Sub btnPrintReport_Click()
Dim vItm As Variant
Dim strCriteria As String
Dim intView As Integer
Dim intWindowMode As Integer
strCriteria = ""
For Each vItm In Me!mslbxSites.ItemsSelected
strCriteria = Trim(Me!mslbxSites.ItemData(vItm))
'For CheckBox named ckPreview, where Default=True
If ckPreview Then
intView = acPreview
intWindowMode = acDialog
Else
intView = acViewNormal
intWindowMode = acWindowNormal
End If
DoCmd.OpenReport "rptSiteSurvey", intView, , "[Site] Like '" &
strCriteria & "*'", intWindowMode
Next vItm
End Sub
"Duane Hookom" <DuaneAtNoSpanHookomDotNet> wrote in message
[SNIP]
--
Duane Hookom
MS Access MVP
dd said:
Regarding my post, titled, "I need a form to select the items to be
presented in the report" at M.P.A.Formscoding, where SteveS very kindly
helped me with the Form:
I have a Building Inspection Database which contains survey data. Using a
form, a query and a report - the form will output multiple
condition-survey
reports for each site selected from the listbox of sites. How do I
combine
these reports into a single report?
Regards
D Dawson