D
Duane Hookom
Where did you place your code? It should be in the On Click event of the
command button that opens your report. Can you copy your complete "sub" in a
reply?
--
Duane Hookom
MS Access MVP
command button that opens your report. Can you copy your complete "sub" in a
reply?
--
Duane Hookom
MS Access MVP
Aviator said:I deleted that line, still receiver error in the VB, "Compile Error:Invalid
Outside Procedure" It then highlights the "" in the third line of the
code.
Duane Hookom said:I am having trouble reading your error message. Did you attempt to
compile
your code? I kinda expect you might have an issue that can't be seen here
due to line wrapping. Try delete the line(s):
' [Airstairs/Entrance] or [Carpet] or [Cockpit Items] or [Complete
Refurbishment] or [Cup Holders] or [Curtain] or [Divan] or [Dye Job] or
[Entertainment] or [Galley] or [Headliner] or [Lavatory] or [Lighting]
or
[Loncoin] or [Lower Side Walls] or [Painting] or [Repairs] or [Runner]
or
[Seat Belts] or [Seats] oror [Telephone] or
[Various/Miscellaneous]
or [Veneer] or [Windowline]
--
Duane Hookom
MS Access MVP
Aviator said:I receive error when running the report. It signals line 3 at the "".
What
do
I put here? Name of the report? Name of the Form?
Dim strWhere As String
Dim ctl As Control
strWhere = "" 'initialize the where clause
For Each ctl In Me.Controls 'loop through all controls on form
'find the check boxes
If ctl.ControlType = acCheckBox Then
'find the true check boxes
If ctl.Value = True Then
'add to the where clause
strWhere = strWhere & "[" & ctl.Tag & "] or "
End If
End If
Next
If Len(strWhere) > 1 Then
'remove the last " or " from the where clause
strWhere = Left(strWhere, Len(strWhere) - 4)
End If
'the final strWhere might look like
' [Airstairs/Entrance] or [Carpet] or [Cockpit Items] or [Complete
Refurbishment] or [Cup Holders] or [Curtain] or [Divan] or [Dye Job] or
[Entertainment] or [Galley] or [Headliner] or [Lavatory] or [Lighting]
or
[Loncoin] or [Lower Side Walls] or [Painting] or [Repairs] or [Runner]
or
[Seat Belts] or [Seats] oror [Telephone] or
[Various/Miscellaneous]
or [Veneer] or [Windowline]
'open the report based on the checked boxes
DoCmd.OpenReport "Type and Work Report", acViewPreview, , strWhere