View Full Version : Create Records automatically on specific times


Djblois
02-24-2009, 08:02 AM
I Wrote an access program for scheduling appointments for a warehouse. Now I would like to include the ability to add recurring appointments. The user can check off on every monday and it will automatically create the appointment every monday. Is this possible? or create a certain amount of them are created into the future. Like create 8 mondays into the future until it gets to 3 weeks before then it creates anothe 5 or something like that. Is this possible?

DCrake
02-25-2009, 03:30 AM
Have a look how Outlook handles recurring appointments and use this as the logic (a bit of reverse engineering). Remember do not clone it or you may be subject to copywrite infringements.

David

gemma-the-husky
02-25-2009, 03:38 AM
but bascially with a bit of code, you can do anything

i do a similar thing for advance scheduling vehicle services

effectively,
do a read to find the latest date currently stored
check this against todays date
if required insert new dates up to a given date
(i use sql insert into statements)

need code for this, as i couldnt do it directly with queries

Djblois
02-25-2009, 05:17 AM
DCrake,

Where do I see how Outlook handles Recurring appointments when I can't get the code? Do you know somewhere where I can get their logic?

gemma-the-husky,

Do you have a sample of code you can send me. I am decent with VBA but I currently know very little with SQL and if I need to use it I have know idea where to start. If you give me a snippet of code I can figure out most of it.

gemma-the-husky
02-25-2009, 05:47 AM
ok

1. do a read to find the latest date currently stored
2. check this against todays date
3. if required insert new dates up to a given date


1. maxdate = dlookup("whatever")
2, requiredmax = date+28 (say, for 4 weeks hence from today)

so then you need something like


'the new maximum date
insertdate=maxdate+7 'start next week
while insertdate<requiredmax
formulate sqlstatement currentdb.execute sqlstatement
insertdate=insertdate+7
wend

so, the sqlstatement needs to be a string looking like

insert into table (field1, field2, field3) select #date1#, "string2", number3

but note that dates and strings etc have to be masked correctly for a valid sql statement, and dates need to be looked at carefully, as they will go in as US dates, not UK dates.

just look at an existing append query to see what the sql should look like

DCrake
02-25-2009, 06:27 AM
Have a look at Outlook > Calander > Actions > New recurring Appointments...