Access Database VBA Error

JERRY89
4StarLounger
Posts: 444
Joined: 21 Feb 2016, 02:52

Access Database VBA Error

Post by JERRY89 »

Dear All,

I have a VBA in Access where it prompt compatibility error on my PC, is there any method to amend this code

Code: Select all

Private Declare Function WinHelp Lib "user32.dll" Alias "WinHelpA" (ByVal hWnd As Long, ByVal _
lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As Long) As Long

User avatar
HansV
Administrator
Posts: 68762
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Access Database VBA Error

Post by HansV »

Try changing the declaration to

Code: Select all

Private Declare PtrSafe Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd As LongPtr, _
    ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As LongPtr) As Long
Regards,
Hans

JERRY89
4StarLounger
Posts: 444
Joined: 21 Feb 2016, 02:52

Re: Access Database VBA Error

Post by JERRY89 »

Hi Hans,

Great...It solved the Error issue successfully.