Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Public Function AccesshInstance() As Long Dim hwnd As Long Dim hInstance As Long Const GWL_HINSTANCE = (-6) AccesshInstance = GetWindowLong(Access.hWndAccessApp, GWL_HINSTANCE) End Function