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

Submitted by: 
Visitors have accessed this post 495 times.

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

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe> [video]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.