I made a module called ShellExecute with the function code in it like so:
Code:
Option Explicit
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal lpnShowCmd As Long) As Long
I then made my on-click event for the keyboard button with the following code:
Code:
Private Sub keyboard_Click()
DoCmd.SetWarnings False
ShellExecute hWndAccessApp, "open", "C:\Windows\System32\osk.exe", 0, 0, 1
'Shell "C:\Windows\System32\osk.exe"
DoCmd.SetWarnings True
End Sub
It gives an error saying it expected a variable or procedure, not a module. Highlighting "ShellExecute"