Help to create and Insert New Target Date record in Subform

R

rbnd2010

I am a newbie to programming in MSAccess. (I'm using Access2007). I have a
mainform (ContentAreas) and a subform (UpdateDates). I also have a database
table (DateSchedule).

The Mainform contains a field: UpdateFrequency
The Subform contains two fields: TargetDate and ActualDate
The DateSchedule table is a list of dates and a "Usable" Yes/No field (to
tell me if that date is a valid date for use)

What I would like to do is when I update the "ActualDate" in the subform, I
would like to calculate the next "TargetDate" by adding the "UpdateFrequency"
to the current record's "TargetDate", look up this new TargetDate in my
"DateSchedule" table and if it "Usable" = 1 then add a new record to my
subform with that date. If it is 0, then I need to find the next 1 date in
"DateSchedule" table and add a new record to my subform with that date.

For example:
UpdateFrequency = 30
Subform TargetDate = 2/1/2010

After I update "ActualDate", I want to add 30 to 2/1/2010 (3/2/2010), look
up 3/2/2010 in "DateSchedule" table. If 3/2/2010's "useable" field = 0, find
next sequential date in DateSchedule with a "useable" field = 1, return that
date (say 3/5/2010), ELSE if 3/2/2010's useable field = 1, then return
3/2/2010.

NewTargetDate = 3/5/2010
Insert new record into my subForm with correct key and TargetDate = 3/5/2010

I don't even know where to begin to pull this off. Any help would be
appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top