Entering values for a range of dates

  • Thread starter Thread starter Samina Gordon
  • Start date Start date
S

Samina Gordon

Hello,

I am trying to get access to take a start date and an end
date and then populate the table with a value for all
dates inbetween the start and the end date.

I have created a form, a calendar control to accept the
dates though, however, I don't know how to force it to
put in multiple records, I can only get it to fill in the
value for a single record.

Can anyone help?

Regards
Samina
 
I am trying to get access to take a start date and an end
date and then populate the table with a value for all
dates inbetween the start and the end date.

It's not usually a good idea to create records just for the sake of it, not
least since it's so easy to create a record when you have some data to put
into it.

Tim F
 
I have a similar problem. Please look at the posting of 11/10/03 under Macros--multiple dates between two dates.
 
Jen,

I am very new at this...I need to do something similar to what was described in this question. I took an intro VB class several years ago but have not used it with Access before. I tried using the code you provided, but when I pasted it into a module window, the line 'addRows(intDiff, dtStart, dtEnd)' was in red font...but I don't know what the problem is.

I would like to transform the following type of table format:

Patient Event Start Stop
1 1 1/1/03 1/2/03
1 2 1/7/03 1/9/03
1 3 2/1/03 2/2/03
2 1 3/1/03 3/3/03

Into a table in which each date in each range, inclusive of the
boundaries, is represented.
Patient Event Date
1 1 1/1/03
1 1 1/2/03
1 2 1/7/03
1 2 1/8/03
1 2 1/9/03
1 3 2/1/03
1 3 2/2/03
2 1 3/1/03
2 1 3/2/03
2 1 3/3/03

Also, once the function is written, how do I invoke it to create the second table?

Any help would be greatly appreciated. Thanks in advance.

Tracy
 
I would like to transform the following type of table format:
....

Into a table in which each date in each range, inclusive of the
boundaries, is represented.

I don't think I would. This really looks like a UI sort of thing, rather
than a database one. Trying to maintain the second table would be a
nightmare. If one row got deleted, does the app assume that the client
wants Mon, Tue, Thu, and Fri or the whole week?

This kind of thing presents really well in something like Excel, where you
can have one row per date, program the colour of the cells to get a really
visual presentation. Printing is not so good, but can be managed. Remember
that VBA in Access is exactly the same as in Excel; the main difference
being that you lose the convenience of CurrentDB() and have to write one
line to CreateObject("DAO.DBEngine") instead. I often feel that Excel runs
faster than Access, but that is purely subjective.

Hope that helps


Tim F
 
Back
Top