Skip to main content

"Compile error: The code in this project must be updated for use on 64-bit systems" error message


This error happens when you run a function that is designed for 32-bit only system.

If you program the function in Microsoft Access 32-bit system and run it on 64-bit version, you will most likely see this error. To fix this problem, all you have to do is add a keyword PtrSafe before the function name like the following:

Private Declare PtrSafe Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long

This article is also an answer from the comments posted at Employee Record Management Information System.

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.