473,394 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Auto create record based on date and criteria in other record

32
I have a db where each record is a certain task to be done. Each record includes the date the task should be completed. Some of the tasks are one time only but some are recurring. I have been having to create a new record for every task even the recurring ones, but I'd like to try to automate creation of the recurring tasks.

What I'm trying to do is set it up so that when I'm setting up a task I can select from a drop down box that this task will not recur or that it will recur every week, month, etc. Then on the date (or the day after) the first task was due I need it to create the task again, but the new task's due date would be set based on the first tasks due date and recurrence interval selected when setting up the first task.

For example, if the original task was:
Fax weekly expense report
Due 9/26/07
Repeat: weekly

I'd like for it to, on 9/26 or 9/27, automatically create this record
Fax weekly expense report
Due 10/3/07
Repeat: weekly

I need to have a record for each task so I can't change the due date on the existing task, and I need the new task record to be created regardless of the previous task being completed.
Sep 26 '07 #1
4 4678
I created a CheckList database that we use at work that produces Checksheets based on tasks as you describe.

You need to have an additional column where the next date the task will be active can be stored. Then use a script to workout when the next active date is and store it in the table.

Then using a report, or form, to display all the tasks have the same active date as the current date.

The command you need (DateAdd) to forecast the next active date is:

ActiveDate = DateAdd("d", 7, StartDate)

The above command will add 7 Days to the StartDate.

Hope this helps

Ian
Sep 26 '07 #2
ringer
32
Thanks for your reply.
I see how you're figuring the next date the task will be needed again, but I also need to write another record to the db for the next task, with the new record being the same as the first task record except that the start date should be set to a future date according to the recurrence frequency of the task.
Sep 27 '07 #3
Thanks for your reply.
I see how you're figuring the next date the task will be needed again, but I also need to write another record to the db for the next task, with the new record being the same as the first task record except that the start date should be set to a future date according to the recurrence frequency of the task.
So you want to add the same record to the same table but with the start date in the future, or add this data into a second table? By storing the future date in the same record and then using a form/report that looks at the future date should cover what I think you are after.

Your table could look like:
Expand|Select|Wrap|Line Numbers
  1. ID  Discription       StartDate   Days  ActDate
  2. 01  Send Fax to ###   1/1/2007    7     1/7/2007
Run the forcast part of the code after the 1/1/2007 it will update to:
Expand|Select|Wrap|Line Numbers
  1. ID  Discription       StartDate   Days  ActDate
  2. 01  Send Fax to ###   1/1/2007    7     8/7/2007
Sep 27 '07 #4
ringer
32
Thanks again for your help.
If I understand correctly, this wouldn't add a separate (new) record for the new task and I that's what I am trying to do. I need a record for each task, both the old and the new.
To answer your question...I do want the new record to go into the same table as the old one.
Sep 27 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: MVA | last post by:
Hi all I have a database where in a table (tbl_Members), there are 2 date fields (DateOfBirth and DateJoined), and also 2 fields which upon entering the data in the form, it automatically works...
2
by: DaveDiego | last post by:
I'm building a report that has a count of cases for employees. I have separate queries that count, OpenCases, NewCases, TotalCases, Etc. I would like to put all those counts into a record for each...
4
by: the hotshot | last post by:
hello, this seems to be a hard question so far and noone has been able to help with this. is it possible to have access start an autonumber with a prefix according to the year when the data is...
3
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
0
by: neoteny2 | last post by:
I need MS Access to automatically create reports/subreports based on specific criteria. I am building a database in Access 2003 with different locations/sites. I have the "sites" table created...
6
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
17
by: Liam.M | last post by:
Hey guys, Forgive me if my question my be alittle silly, but I would very much appreciate and assistance that could be given! My situation is as follows: I have created a Button, and set...
5
by: mebrabham | last post by:
Hello, I am trying to create a running subtotal in a query and then graph the running subtotal for each city group. The data looks like this in the table (for illustration): My City My...
2
by: Ronald | last post by:
I hope somebody can help. I can't get into the specifics of my project, but I'll try to create a simple example: tblVehicle * VIN (text box) * Make (text box) * Model (text box) frmRepair
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.