I have an ms access 2013 db on a WIN 10 64 bit machine.
What I'm trying to achieve is to have my login form showing up without the database window frame, just the form alone, then (after login) restore the database window.
I am using this code I found somewhere:
My problem is that, when I restore (normal or maximized) it shows the window frame but nothing inside: ribbon, tables, etc... all gone.
Probably is an api issue but do you guys have a better solution or how can I force somehow the window to refresh/show missing elements?
What I'm trying to achieve is to have my login form showing up without the database window frame, just the form alone, then (after login) restore the database window.
I am using this code I found somewhere:
Code:
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare PtrSafe Function apiShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Function fSetAccessWindow(nCmdShow As Long)
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm
If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
MsgBox "Cannot minimize Access with " _
& (loForm.Caption + " ") _
& "form on screen"
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
MsgBox "Cannot hide Access with " _
& (loForm.Caption + " ") _
& "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
fSetAccessWindow = (loX <> 0)
End Function
My problem is that, when I restore (normal or maximized) it shows the window frame but nothing inside: ribbon, tables, etc... all gone.
Probably is an api issue but do you guys have a better solution or how can I force somehow the window to refresh/show missing elements?