>Andy,
>Thanks for your advise. I made the change as you suggest. No more =
>error
>messages. I created the command button with the following set for the =
>on
>click's Event Procedure, but nothing happens:
>Private Sub Command38_Click()
>End Sub
>Function AccessToProjectAutomation()
>End Function
>I feel that I'm getting closer, but there's something still missing.
>Thanks,
>John
>>Perhaps the advice you were given had to do with the fact that you are
>>using a DAO recordset rather than an ADO recordset. Maybe the A in ADO
>>is the "ActiveX" you referred to. Your code will work as long as you
>>open the References dialog and set a reference to DAO (if one isn't
>>set already). You then just need to change the recordset declaration
>>to:
>>Dim dynTasks As DAO.Recordset
>>Alternatively, you could change your syntax to work with an ADO
>>recordset, but if you are using other existing code, sticking with DAO
>>will be easier while you start learning about ADO.
>> -- Andy
>>>I have developed a strategic planning software application using MS ACCESS
>>>2000. I can generate all the tasks activity reports I want. But, it
>would
>>>be great if I could generate MS Project timelines driven FROM my MS Access
>>>application. However, I'm using code via a command button (see, below)
>that
>>>I am told will not work in MS Access 2000, and that I should be using
>Active
>>>X. Any ideas?
>>>I used a book called, "Access 97 Power Programming, by Scott Bullock
>Access
>>>Development manager Microsoft". On page 362-365 it presents the following
>>>code on how it works:
>>>Function AccessToProjectAutomation()
>>>Dim dblocal As Database
>>>Dim dynTasks As Recordset
>>>Dim intCurrTask As Integer
>>>On Error GoTo Error_OLEAccessToProject
>>>Set dblocal = CurrentDb()
>>>Set dynTasks = dblocal.OpenRecordset("Tasks", dbOpenDynaset)
>>>'--Create an instance of Project
>>>SetobjProject = CreateObject(Class:="MSProject.Application.4_1")
>>>With objProject
>>>..DisplayAlerts = False
>>>..FileNew
>>>End With
>>>'--Initialize the counter for the Unique Task ID
>>>intCurrTask = 0
>>>Do Until dynTasks.EOF
>>>'--Increment the counter for the Task ID
>>>intCurrTask = intCurrTask + 1
>>>'--Use the SetTaskField method to
>>>'--Write data from Access record to Project
>>>objProject.SetTaskField "Name", dynTasks!Tasks, intCurrTask
>>>objProject.SetTaskField "Start", dynTasks!start, intCurrTask
>>>objProject.SetTaskField "Duration", dynTasks!Duration, intCurrTask
>>>objProject.SetTaskField "Predecessors", dynTasks!Predecessors, intCurrTask
>>>objProject.SetTaskField "Resource Names", dynTasks!Resources, intCurrTask
>>>dynTasks.MoveNext
>>>Loop
>>>'--Make project visible
>>>With objProject
>>>..Visible = True
>>>..AppMaximize
>>>End With
>>>Exit Function
>>>Thanks,
>>>John Phelan
>>>Thanks,
>>>John Phelan