Solved

How to run a report with no criteria

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

696 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