VBA MS Access for 32-bits / 64-bits – PtrSafe declaration

The expression On Load you entered as the event property setting produced the following error: The code in this project​ must be updated for use on 64-bit system. Please review and update Declare statements and then mark them with the PtrSafe attribute.

So the issue is linked to declare function or declare sub function in VBA and when we use in Office 64-bits which is using VBA version 7 (VBA7), it’s not allowed without “PtrSafe” keyword.

To make those lines work on both 32-bits and 64-bits Office version, we need to use condition with VBA7 as following