programming

G

Guest

I built a maintenance database for routine maintenence on machines. The feild
that pertain to my question is the due date.
Question is, if i have, for example, a daily task that says start 12-17-05,
how do i make it generate a work order for the 18th, 19th, and so on?
I want to click a generate button and see what i have scheduled for that
week, or day, month, whatever.
After generation, i want that page to go to a section in my database called
tasks.
I can do this in steps, if easier.
Anybody have any ideas?
 
B

Branden Johnson

I am currently in the process of creating a similar program. I am utilizing
Outlook's calendar and tasks to accomplish this due to the nice printouts I
can get (i.e. Daily, Weekly, Monthly, etc...).

You will need to create a new Calendar, if you want to keep it separate from
your main calendar, under the Personal Folders called "Scheduled
Maintenance".

Your basic VB sub would look like this:

Private Sub NewAppointment()
Dim oOutlook As Outlook.Application
Dim oNameSpace As Outlook.NameSpace
Dim oFolder1 As Outlook.MAPIFolder
Dim oFolder2 As Outlook.MAPIFolder
Dim oAppt As Outlook.AppointmentItem

Set oOutlook = New Outlook.Application
Set oNameSpace = oOutlook.GetNamespace("MAPI")
Set oFolder1 = oNameSpace.Folders("Personal Folders")
Set oFolder2 = oFolder1.Folders("Scheduled Maintenance")
Set oAppt = oFolder2.Items.Add(olAppointmentItem)

With oAppt
.Start = txtApptData(0).Text
.Duration = txtApptData(1).Text
.Subject = txtApptData(2).Text
.Save
.Close (olSave)
End With
End Sub

You would probably want to set up all your scheduled items in a Access table
and iterate through them, creating a single appointment for each with a
For...Next loop calling a variation the sub above. You can also set up
reoccuring appointments by adding some info to the With oAppt portion of the
sub.

Hope this helps get you started and isn't too confusing.

Branden Johnson
BMJ Computing
 

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