pdvsa
asked on
Open Report , Where condition
Experts, how do I open the report with the where condition below? There is an error on the bold part. thank you
Private Sub Command74_Click()
Minimize
DoCmd.OpenReport "rptQry_FX_Expected", acViewPreview,,[Status] Not Like "*Dead*" And Not Like "*lost*" And Not Like "*Award*" And Not Like "*Won*"
End Sub
Private Sub Command74_Click()
Minimize
DoCmd.OpenReport "rptQry_FX_Expected", acViewPreview,,[Status] Not Like "*Dead*" And Not Like "*lost*" And Not Like "*Award*" And Not Like "*Won*"
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
so you want to use one query, yet have different buttons on the Form, each with a different condition (Filter ing the query further),
In this case, one way to do this is by using the query as is, and using the Report Filter for the further "Filtering".
Assuming your command button event is as you mentioned above:
You just have to check your Where condition syntax, and the query is the best place to fine tune it.
jaffer
In this case, one way to do this is by using the query as is, and using the Report Filter for the further "Filtering".
Assuming your command button event is as you mentioned above:
Private Sub Command74_Click()
Minimize
DoCmd.OpenReport "rptQry_FX_Expected", acViewPreview
Reports!rptQry_FX_Expected.Filter="[Status] Not Like '*Dead*' And [Status] Not Like '*lost*' And [Status] Not Like '*Award*' And [Status] Not Like '*Won*'"
Reports!rptQry_FX_Expected.FilterOn=true
End Sub
You just have to check your Where condition syntax, and the query is the best place to fine tune it.
jaffer
ASKER
ahhhh...I see ....I have never used that before. Looks nice. I will test in a couple hours. I am sure that is what I am looking for though.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
very nice! thank you for the explanation too. I wrote that down.
you are welcome, and thanks for the points and grade :)
jaffer
jaffer
ASKER
What do you think now? thank you