Solved

How to run a report with no criteria

Posted on 2014-09-29
3
392 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

737 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