We help IT Professionals succeed at work.
Get Started

Print rport button w "Where =" conditions.

Ken Milam
Ken Milam asked
Last Modified: 2020-02-15
I have a form [f-BagLabel] on to which I would like to place a "Print Report" Button.  A similar report [r-BagLabel] already exists, and its based on a query [q-r-BagLabel].  In this case, however, I want the PrintReport button to print a report specific to the current record at [f-BagLabel]

Ordinarily, I would copy the report and copy the query, associate some query criteria from [f-BagLabel] into the new query and associate the new copied report with the new query w/ criteria.  Then, I would add a button that would open this newly created report.  This, as I am sure you are aware, results in multiple instances of the similar queries and reports.  I need to learn how to use conditions in VBA to accomplish this task w/o resorting to my current technique.

How would I incorporate some VBA into this Button to print a report whereby a field in q-r-BagLabel = some value on the form where the button is positioned?

Watch Question
President / Owner
Most Valuable Expert 2017
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE