Solved

How to run a report with no criteria

Posted on 2014-09-29
3
356 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
DCount using "OR" 4 19
Multiple queries for a form 14 22
Converting Access 97 database to 2007 database 3 15
Query 14 22
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

744 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

13 Experts available now in Live!

Get 1:1 Help Now