32bit to 64bit change... need help RRS feed

  • Question

  • I am migrating from Win7 to Win10, and from 32 bit to 64bit. I get an error when I load a particular VBA program.

    "compile error:

    The code in this project must be updated for use on 64-bit systems. Please review Declare statements and then mark them with the PtrSafe attribute."

    I do not know how to accomplish this. Can anyone help me out?

    Sunday, December 8, 2019 4:38 PM

All replies

  • I would use my search engine to search for "Access declare ptrsafe 64" and you will get several promising leads, including this one for the Windows API:

    -Tom. Microsoft Access MVP

    Sunday, December 8, 2019 5:03 PM
  • In your VBA code Declare statements:

    Change all your:

    Public Declare and Private Declare


    Public Declare PtrSafe and Private Declare PtrSafe

    Sunday, December 8, 2019 9:18 PM
  • @Lawrence: that's not all of it. That's the last step. Per the help file: "The PtrSafe keyword asserts that a Declare statement is safe to run in 64-bit development environments."

    This implies that developer has reviewed the declarations and made the necessary adjustments, then certifies correctness by affixing the PtrSafe keyword. Think LongPtr and other possible adjustments.

    -Tom. Microsoft Access MVP

    Sunday, December 8, 2019 9:37 PM
  • I'd ask why change to 64-bit?  What needs require it?  Otherwise, just install the 32-but version and avoid all these headaches.

    If you stick with 64-bit, you may find the following link useful

    You might want to make a copy available to us to review (removing any sensitive information first).

    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support:
    MS Access Tips and Code Samples:

    Sunday, December 8, 2019 10:13 PM
  • Good choice as 64BIT OS is the current type,even NVIDIA mfg stopped updates with 32BIT.64BIT OS can/will run 32BIT software when needed.Also,to upgrade to Win 10 OS,download Microsoft/Windows Media Creation Tool,follow the TechNet link.

    Also listed is OS upgrade advisor,don't forget,all pc MB hardware controllers/Chips must be reinstalled,get all from pc mfg,or pc hardware mfg(Intel/AMD/etc)..

    Sunday, December 8, 2019 11:38 PM
  • For the OS, fine, 64-bit, but for MS Office there is no reason to do so for 90+% of users.

    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support:
    MS Access Tips and Code Samples:

    Monday, December 9, 2019 12:39 AM