Solved

MS Access How to automatically fill in my calendar report with start and end dates?

Posted on 2012-12-31
9
991 Views
Last Modified: 2013-01-03
I created a scheduler where the user inputs name and start and end dates.

My report will display all days in the month.

How can I auto fill the dates in the report?
I.E. the user will be on vacation from 12-1-12 to 12-7-12 according to the form input.

I would like all date boxes from 12-1-12 to 12-7-12 to display the employee name and event (vacation).
0
Comment
Question by:DJPr0
9 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38733375
You can do this with a Grouped Report or a sub report.
(One date, many possible Events)

You also need a system that will Generate (or display) ALL dates in the given range
(Typically just a table with all dates listed.)
...To be the "parent" record
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38733472
There are a lot of detail missing here, so my guess is that you just need a starting point

Something "roughly" like this:
Database10.accdb
0
 
LVL 30

Expert Comment

by:hnasr
ID: 38733888
"I created a scheduler where ..."

You have the data: upload to help saving time

Explain how to display the report manually.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 38734560
As boag suggested, I always have a table in my database used for this type of purchase.  The table has preloaded one record for every date from 1900 through 2100 (or whatever range you need as a max).   For convenience, I have other date related columns indicating whether whether the date is a weekend, holiday, the date in text format, the day of week in text format (Mon, Tue, Wed...) and stuff like that.   Although you can (sometimes) easily derrive these, its so simple to pull it from the table if you're going to join it anyway.


 In addition to the date columns, I have a number column which is just 0 through X.   This also comes in handy when filling in missing numbers or doing dateAdd functions.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:DJPr0
ID: 38736640
Database10.accdb - The form will display a date range provided.

How can I create a form for user input into to the  tblappointments table a date range instead of the user inputting day by day input I.E. 12-1-12 vacation, 12-2-12 vacation, 12-3-12 vacation etc...

I would like to use a table with date ranges to supply the Database10.accdb form report.
RecordID  RecordDateFrom  RecordDateTo EmpID ReasonCode
1                   12-1-12                            12-7-12             4               101

Form report will display all days in the range provided I.E.
EmpID  Date      ReasonCode
John     12-1-12  Vacation
John     12-2-12  Vacation
John     12-3-12  Vacation
John     12-4-12  Vacation
John     12-5-12  Vacation
John     12-6-12  Vacation
John     12-7-12  Vacation
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 38738864
Oh!

I misunderstood your question.
Try this sample

Then, all you have to do now is create a form and a Report based on qryEmpTimeOff

;-)

JeffCoachman
Database10.accdb
0
 

Author Comment

by:DJPr0
ID: 38741624
Thanks Jeff!

Your database example works great!

Do I increase the Refdate for future years?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38741679
Refdate was only there because I thought this was primarily a "Report" question, and you wanted to display all dates, even if not Time off was requested for that day.

You can still keep it (and update it) for that reason (to show all dates in a report), but as far as the code I posted, ...it is irrelevant.
0
 

Author Closing Comment

by:DJPr0
ID: 38742397
Thanks again Jeff!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

747 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