|
![]() |
| Here's an example of how you might use Milestones Professional's OLE Automation to take information from an Access Table and generate a formatted project schedule. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The "ScheduleData" Access table: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The Milestones Professional Schedule: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The Access Visual Basic Program: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Here's a Visual Basic Program that generates an outlined Milestones Professional schedule using the data in the Access table. The Milestones OLE calls are displayed in red. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Public Sub CreateSchedule() ' this function updates the schedule using data from a table Dim dbsCurrent As Database Dim rstTable1 As Recordset Dim numberoftasklines As Integer Dim numberofsymbols As Integer Dim x As Integer Dim x2 As Integer Dim TaskNumber As Integer 'Identify the table Set dbsCurrent = CurrentDb() Set rstTable1 = dbsCurrent.OpenRecordset("scheduledata", dbOpenTable) Set objMilestones = CreateObject("Milestones") With objMilestones ' Locate first record. rstTable1.MoveFirst ' Activate Milestones Professional Schedule .Activate .Template "AccessTemplate.mtp" .Refresh TaskNumber = 0 'Start of loop
On Error GoTo SkipDate
'Use Milestones Professional OLE Automation calls to add symbols to the schedule .SetOutlineLevel TaskNumber, rstTable1!OutlineLevel SkipDate:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| To try this example: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Click here to download a self-extracting EXE file containing: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - The Access Database (AccessExample.mdb) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - The Milestones Professional Template (AccessTemplate.mtp) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (This download is recommended for experienced Access users with some programming knowledge.) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For other examples, look at the Excel Example page. Anything that can be done in Excel can also be done in Access. |
| Click here to visit our main programmer's page. |
