By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,779 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,779 IT Pros & Developers. It's quick & easy.

form onClick OpenReport vs. report onOpen applyFilter

P: n/a
I have a continuous form with a list of items from a table. One of the
fields in the table is "print". this allows the user to select items from
the list on the form for printing in a report. on that form i have a button
with the following onclick event:

DoCmd.OpenReport "rptCustomerReport", acViewPreview, , "Print = True"

This opens the report "rptCustomerReport" and shows all of the records that
the user had checked of on the form. If no records are checked, the report
opens with one blank record. Exactly as I want it to work.

I am trying to set up the report so that it filters for these records in the
onopen event of the report instead of from the form. i put the following
code in the onOpen event of the report:

DoCmd.ApplyFilter , Forms!frmPlantListBot!PrintCheck = True

If no records are selected on the form (which is open) then one blank record
is displayed, same as before. However, if I check of any of the boxes on the
form (control is named 'printCheck' on the form, controlsource is 'print'
from the underlying table) then all of the records show up on the report,
not just the ones that have been checked off.

what am i missing?
Sep 8 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
take a look at the Filter Property topic in VBA Help; that may work for you,
rather than the ApplyFilter command.

hth
"Jimmy Stewart" <no**@none.comwrote in message
news:oI*********************@fe04.news.easynews.co m...
I have a continuous form with a list of items from a table. One of the
fields in the table is "print". this allows the user to select items from
the list on the form for printing in a report. on that form i have a
button
with the following onclick event:

DoCmd.OpenReport "rptCustomerReport", acViewPreview, , "Print = True"

This opens the report "rptCustomerReport" and shows all of the records
that
the user had checked of on the form. If no records are checked, the report
opens with one blank record. Exactly as I want it to work.

I am trying to set up the report so that it filters for these records in
the
onopen event of the report instead of from the form. i put the following
code in the onOpen event of the report:

DoCmd.ApplyFilter , Forms!frmPlantListBot!PrintCheck = True

If no records are selected on the form (which is open) then one blank
record
is displayed, same as before. However, if I check of any of the boxes on
the
form (control is named 'printCheck' on the form, controlsource is 'print'
from the underlying table) then all of the records show up on the report,
not just the ones that have been checked off.

what am i missing?


Sep 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.