CheckBox

A

Alex

Hi, I have a report that is run from different queries.
On my Form, I want to put a check box, which by checking
it, it will cause one of the queries of the report to
EXEMPT records that have a certain field...so it won't
show on the report. I was thinking to code for the
cmdRUNREPORT...IF chkBOX=True then <> "Shanghia" and
<> "JAPAN" in that particular query..just dont know how to
code it...or maybe in the query criteria put in somehow
[Forms]![SmallBusiness][chkox]=True, <>Shanghia And <>
Japan....please help out..I think im on the right track
not sure.
 
T

tina

you shouldn't have to change the report's underlying query at all. try
below, substituting the correct report and field names, of course.

*first line of macro*
Macro Name: open report
Condition: [chkBox] = True
Action: OpenReport
Action Arguments
Report Name: MyReportName
View: (Print or Print Preview - whichever you want)
Filter Name: (leave blank)
Where Condition: [Fieldname] Not Like "Shanghai" And [Fieldname] Not Like
"Japan"

*second line of macro*
Macro Name: (leave blank)
Condition: ...
Action: StopMacro

*third line of macro*
Macro Name: (leave blank)
Condition: (leave blank)
Action: OpenReport
Action Arguments
Report Name: MyReportName
View: (Print or Print Preview - whichever you want)
Filter Name: (leave blank)
Where Condition: (leave blank)

*fourth line of macro*
Macro Name: (leave blank)
Condition: (leave blank)
Action: StopMacro

you can do essentially the same thing in VBA code, of course, but i gave you
a macro setup because you posted in the macro newsgroup.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top