Filter During "On Click" Event

  • Thread starter Thread starter HollyH
  • Start date Start date
H

HollyH

I have a command button opening a report called "reference
number summary".

I need it to filter for an entered period (period is XXXX-X
with the first four numerals being the period and the last
numeral being the week number in the period) and for the
company name not equaling "MEI-C".

The first one will need to be a like statement and the
second a <> statement, but I keep getting type mismatches
and know I am getting my " in the wrong place. Both fields
are text.

This is what I started with:
"[WEEK]" Like "([Enter Period Number] & " * ")"

I haven't yet added the:
And ("[CompanyN]" <> "MEI-C")

I need some help to get this working smoothly.
Thanks
 
Create a query and use this query against your report. In the criteria
section for Company Name type: <> "MEI-C" . On the same line but under the
Period field's criteria area type: Like [Enter Period] & "*". Then when your
users execute the command button on the form, it will give them the report
they need with the period they need.
If they just press enter, they will get all periods where the Company name
is not equal to MEI-C.
 
The problem is that I need to open this report in several
configurations. I have one where it opens based on the
reference number that is entered and includes all of the
data for all of the associated periods. I will have one
that I described below that will print a batch by period
excluding MEI-C. I will have one that includes only MEI-C
in the batch. Lastly I will have one that is by reference
number for an individual period.

I decided that one report with the filter criteria in the
buttons would be the best option. I didn't want to create
a separate report for each option.

Holly H

-----Original Message-----
Create a query and use this query against your report. In the criteria
section for Company Name type: <> "MEI-C" . On the same line but under the
Period field's criteria area type: Like [Enter Period] & "*". Then when your
users execute the command button on the form, it will give them the report
they need with the period they need.
If they just press enter, they will get all periods where the Company name
is not equal to MEI-C.
--
G Vaught

HollyH said:
I have a command button opening a report called "reference
number summary".

I need it to filter for an entered period (period is XXXX-X
with the first four numerals being the period and the last
numeral being the week number in the period) and for the
company name not equaling "MEI-C".

The first one will need to be a like statement and the
second a <> statement, but I keep getting type mismatches
and know I am getting my " in the wrong place. Both fields
are text.

This is what I started with:
"[WEEK]" Like "([Enter Period Number] & " * ")"

I haven't yet added the:
And ("[CompanyN]" <> "MEI-C")

I need some help to get this working smoothly.
Thanks


.
 
Back
Top