By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,644 Members | 2,423 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,644 IT Pros & Developers. It's quick & easy.

Adding extra dates to a report.

P: n/a
I have a report which is printed daily. It is a list of people. A person
can be put on this list for one day, which is easyily achieved from a simple
form. My problem is that a person can also be put on the list for a number
of days. The information that I would then have is the person,s ID, name,
the first date they are on the list and the number of days they are on the
list. Assuming that the dates are consecutive (although weekends will cause
a problem as it is a 5 day work situation) how can I get the person to show
on the list for the 2nd, 3rd, 4th etc days. I know it can be achieved by
code, but I can't see how.

dixie
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
A report always displays data that is in a table or is calculated on the fly. In
your case, your data comes from a table through a query that returns only the
persons for a selected day. So you need to look at how the data is entered into
your table, ie, if a person is to appear on your report for multiple days, that
person must be enterd in your table multiple times. It seems you need two tables
for this:

TblPerson
PersonID
FirstName
LastName

TblPersonOnReport
PersonOnReportID
PersonID
DateOfReport

TblPerson would include the record 1 Dixie C. Then if Dixie C is to be on
the report 3 times, you need three records in TblPersonOnReport:
1 1 11/25/03
2 1 11/26/03
3 1 11/27/03

You need to look at how to get these three records in TblPersonOnReport.

Your query would include both tables to get the person's full name and the
DateOfReport field where you set the criteria of this field to the date you want
the report for.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"dixie" <di****@dogmail.com> wrote in message
news:qz****************@nnrp1.ozemail.com.au...
I have a report which is printed daily. It is a list of people. A person
can be put on this list for one day, which is easyily achieved from a simple
form. My problem is that a person can also be put on the list for a number
of days. The information that I would then have is the person,s ID, name,
the first date they are on the list and the number of days they are on the
list. Assuming that the dates are consecutive (although weekends will cause
a problem as it is a 5 day work situation) how can I get the person to show
on the list for the 2nd, 3rd, 4th etc days. I know it can be achieved by
code, but I can't see how.

dixie

Nov 12 '05 #2

P: n/a
Look at this thread:
Re: Produce some kind of calendar in Access?

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:3f**********************@freenews.iinet.net.a u...
So you need to create additional records in the same table?

This code is a quick demo of how to create an appointment for each
additional day after the StartDate, at the time the record is saved in the
form. It does not handle deleting all or part of the appointment, or
modifying a date. (It may actually be better to use an unbound form to add
the appointment for all days, including the original. To do that you would
OpenRecordset on the table.)

Private Sub Form_AfterInsert()
Dim dtWhen As Date

With Me.RecordsetClone
For dtWhen = Me.StartDate + 1 To Me.StartDate + Me.HowLong
.AddNew
!Name = Me![Name]
![Kind of Appointment] = Me![Kind of Appointment]
!StartDate = dtWhen
.Update
Next
End With
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Henro V" <ma**********@hotmail.com> wrote in message
news:bp**********@news4.tilbu1.nb.home.nl...
I am byuilding this database which (among others things) will have to
produce a kind of calendar.

Users give in the appointments they have and how long they take.
F.e: John Doe is attending a conference which will take three days. This
conference starts on 12-07-2004

So the user would give in

a) Name John Doe (selectable from a list,
already done that)
b) Kind of appointment Conference (selectable from a list,

already
done that)
c) Startdate 12-07-2004 Date/Time field
d) Howlong 3 Numeric field

Now it is very simple to calculate the Enddate(Startdate+HowLong-1)
I know how to convince Access2K to fill in an Excelsheet That John Doe is attending a conference starting 12-07-2004. I can also see that very

clearly
and easily in the Excelsheet I produce. But I need it to fill it in also

for
the days 13-07 and 14-07. In fact, it needs to fill in all the dates
starting with the Startdate, ending with the enddate.

How do I do this? I am pretty worthless if it comes up to code so I would prefer it to be done in a query of some sort but, to be honest, I am

pretty
desperate now so I would even be prepared to hammer it in as they did in

the
Stone-age :-p as long as I find a solution for this problem!



"dixie" <di****@dogmail.com> wrote in message
news:qz****************@nnrp1.ozemail.com.au... I have a report which is printed daily. It is a list of people. A person
can be put on this list for one day, which is easyily achieved from a simple form. My problem is that a person can also be put on the list for a number of days. The information that I would then have is the person,s ID, name,
the first date they are on the list and the number of days they are on the
list. Assuming that the dates are consecutive (although weekends will cause a problem as it is a 5 day work situation) how can I get the person to show on the list for the 2nd, 3rd, 4th etc days. I know it can be achieved by
code, but I can't see how.

dixie

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.