none
Editing Access 2007 VBA code within Visual Studio RRS feed

  • Question

  • I am currently working on a program within Access 2007, and I would like to transfer the code to Visual Studio 2017 so that I may edit it within Visual Studio. However, if I simply copy and paste my code over, then Visual Studio lights up with red bars and errors. I believe that this is due in part from Visual Studio using more up to date VBA rules, while Access 2007 does not. Is there any way for me to fix this, so that I may edit the code within Visual Studio?
    Wednesday, January 24, 2018 5:50 PM

All replies

  • You better ask this in the right forum for VBA, this one is for VB for .Net 

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=issvvba


    Success Cor

    Wednesday, January 24, 2018 6:20 PM
  • Did you add references to the project and add a import statement in the code module you are working in within Visual Studio, if not Visual Studio has no clue to what you are doing for starters.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, January 24, 2018 6:24 PM
  • Oops, my mistake.

    Thanks for the correction, I'll take a look. 

    Wednesday, January 24, 2018 6:32 PM
  • Did you add references to the project and add a import statement in the code module you are working in within Visual Studio, if not Visual Studio has no clue to what you are doing for starters.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    I did not yet try to add references, however I did try adding an import statement. Although the errors are not only reference errors, I am experiencing one issue with Let and Set assignments, as I utilize them within Access 2007, but Visual Studio notifies me that they are no longer supported.

    Wednesday, January 24, 2018 6:36 PM
  • For the benefit of others this has been re-posted as Editing Access 2007 VBA code within Visual Studio.


    Sam Hobbs
    SimpleSamples.Info

    Wednesday, January 24, 2018 8:16 PM
  • I'm going to move your question to the VBA forum which Cor mentioned earlier as there is not much more to offer here.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, January 24, 2018 8:26 PM