Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 10th, 2005, 08:23 PM
Registered User
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date Ranges


Can an expert PLEASE, PLEASE help?? I'll need detail as I'm relatively new to Access and have difficulty knowing where to place statements . . . codes, etc., if VBA is the solution, I need opening and ending statements.

I have a visitor database. Many visitors will have various start and end dates. We have a DAILY report that is generated at the end of each day with the next day's date entered as a prompt to open the report. This report is required to show individuals registered to visit each day.

My Visitor db has a start date and end date field. Example start date for visitor #1 could be 10/25/05 with an end date of 10/31/05. Visitor #2 might also have a start date of 10/25/05 but an end date of 11/20/05.

When I open my DAILY visitor report and enter the next day's date.I will need all visitors to appear on the DAILY report with an increment of 1 day added to each subsequent visit day but drop off the report once it is greater than the end date. Ex: when the original start date of 10/25/05 is entered, both visitors #1 and #2 appear on the report. When the second date arrives and I enter 10/26/05 as the report prompt date, these two visitors appear again and so on and so on until the start date is greater than the end date, at which time the appropriate visitor will drop off the report.

Hope I explained this clearly . . . not real familiar with the appropriate jargon.


Reply With Quote
  #2 (permalink)  
Old December 12th, 2005, 12:45 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

Don't enter the date in the report. Enter the date in the FORM. When you do that, open the report (via a button, for example) with this on the button's ON CLICK event. Assuming the report date is a textbox called txtRptDate and the start and end dates are called dtmStartDate and dtmEndDate in the report's underlying table or query:

Dim strCriteria as String

strCriteria = "[dtmStartDate] <= #" & Me.txtRptDate & _
"# And [dtmEndDate] >= #" & Me.txtRptDate & "#"

DoCmd.OpenReport "Your Real Report Name Here", acPreview, , strCriteria

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
puzzle for date ranges navjot C# 1 October 16th, 2008 02:21 PM
Copying ranges mtowle Excel VBA 2 November 2nd, 2005 06:35 AM
date ranges yuqlin BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 December 23rd, 2004 05:23 PM
Query regarding Date Ranges spraveens SQL Language 7 January 13th, 2004 08:11 AM
Query Returning Date Ranges rstelma SQL Server 2000 4 October 28th, 2003 08:57 PM

All times are GMT -4. The time now is 12:04 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.