0

Trying to call the MS project in the Access Module, but I'm having trouble with the syntax. Basically I'm looping through both to compare the ID and if they match, update another cell.

Here's what I have so far

Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Select * From ['Access'])

AllForms='MS Project'

While Not rs.EOF
  While Not AllForms.EOF
    If ('Access Column')=('MS Project Column') Then

    'Access Cell' = 'Ms Project Cell'  


    End if
   Allforms.MoveNext 
   Wend
rs.MoveNext
Wend
  • Certainly not valid syntax. Declared rs as variable but reference re. Need to include `Option Explicit` at top of every module. Set this as default in VBA editor > Tools > Options > Editor > Require Variable Declaration. What is 'trouble' - error message, wrong result, nothing happens? – June7 Nov 12 '19 at 20:31
  • I'm simply using pseudo code for the logic, I made a mistake and typed "re" instead of "rs" sorry about that. "Option Explicit" is at the top in the actual code. By "trouble" I mean that I've been unable to find the syntax on referencing MS project in Acess vba, nothing happens when I run it since its obviously not valid. – Jackson Wicktora Nov 12 '19 at 21:11
  • Do you want to update an MS Project schedule with data from Access? Or update Access with MS Project data? – Rachel Hettinger Nov 12 '19 at 21:37
  • The typical way to do this is through automation. Here's a good SO post about automating Excel from Access; the concepts apply to Project as well: [stackoverflow...how-to-use-vba-to-automate-several-office-applications](https://stackoverflow.com/questions/894799/how-to-use-vba-to-automate-several-office-applications). Learn about automation and the [Project object model](https://learn.microsoft.com/en-us/office/vba/api/project.object), try it yourself and when you have a specific issue with the code, post a question about it. – Rachel Hettinger Nov 12 '19 at 22:45
  • Also see [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) and [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – Rachel Hettinger Nov 12 '19 at 22:49
  • Also from that same MSKB reference https://learn.microsoft.com/en-us/office/vba/api/project.application. – June7 Nov 13 '19 at 02:19

0 Answers0