Solved

How to run a report with no criteria

Posted on 2014-09-29
3
368 Views
Last Modified: 2014-09-29
Excellent video.  I am a novice so don't assume I know anything.

In the example code with a Start and End date in the criteria form it doesn't appear to allow for running the report with NO start and end date.  i.e. unfiltered.  

Please show the code needed to do that
0
Comment
Question by:Wayne Markel
3 Comments
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 500 total points
ID: 40349986
I would have to see the form to give more specific advice, but the code could be written to copy an unfiltered query to the report's record source query if no criteria are selected, or a filtered query if some filter values are selected.  See my Fancy Forms sample database for one way to do this:

http://www.helenfeddema.com/Files/accarch129.zip

Here is a screen shot of the form:

Fancy Filters form
0
 
LVL 84
ID: 40349988
Which video were you viewing? For some reason, it's not linked here.

In most cases, you just check to see if the user has entered values in your Start and End date boxes, and then move along from there. For example:

If Nz(Me.txtStart, "") = "" And Nz(Me.txtEnd, "") = "" Then
  '/ user did NOT enter any dates
  DoCmd.OpenReport "YourReport" etc etc
Else
  '/ user did enter dates, so create the filter below

End If
0
 

Author Closing Comment

by:Wayne Markel
ID: 40350424
This solution goes far beyond my expectations.  As a novice ACCESS developer I was looking for a verse and got the BIBLE!

Thanks,

Wayne
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now