We help IT Professionals succeed at work.

VBA 64-bit All Declare Statement must now include the PtrSafe keyword

I opened an Access database on a 64-bit machine and received the above error.
How do I add a PtrSafe keyword to a Declare statement?
Comment
Watch Question

BRONZE EXPERT
Commented:
Jim Dettman (EE MVE)President / Owner
GOLD EXPERT
Fellow
Most Valuable Expert 2017
Commented:
Note that it's not so much that your on a 64 bit machine, but that you have a 64 bit install of Access.

If you want the same DB to work in both environments, then your going to need to use complier directives.

Also, besides the URL's posted by als315, you will probably be interested in these:

All the new 64 bit calls:

http://www.microsoft.com/download/en/confirmation.aspx?displaylang=en&id=9970

Code inspector for 64 bit:

Microsoft Office Code Compatibility Inspector user's guide
http://technet.microsoft.com/en-us/library/ee833946.aspx

List of all the calls that were modified for 64 bit:
http://msdn.microsoft.com/en-us/library/aa383663(VS.85).aspx

Jim
This was quite helpful to me.  Thanks.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.