Opening an filtering a Report

lovett10

Registered User.
Local time
Today, 14:17
Joined
Dec 1, 2011
Messages
150
Opening and filtering a Report

To start id like to say i dont know very much about VBA..

I have this code...

Private Sub Command55_Click()
DoCmd.OpenReport "VisitSheetTableReport", acViewPreview, , "Engineer 1'*" & Combo50 & "*'"
End Sub

Its giving me a Run-time error '2447': and saying there is an invalid use of the . (dot) or ! operator or invalid parentheses.

What i am trying to achieve is for the report to open and filter the results so that what the selection in Combo50 is will filter the field "Engineer 1".

Thanks in advanced for any help and please let me know if im unclear
 
Last edited:
Re: Opening and filtering a Report

For peoples information i have solved this part myself using...


Dim strFilter As String
Dim VarItem As Variant
strFilter = "[Engineer 1] = '" & Me!Combo50 & "'Or " & _
"[Engineer 2] = '" & Me!Combo50 & "'"
DoCmd.OpenReport "VisitSheetTableReport", acPreview, , strFilter

Now what i am trying to achieve is using the same method filtering between DTPicker5 and DTPicker6 which are two activeX calenders
 

Users who are viewing this thread

Back
Top Bottom