Hi,
After coming across the below code and [FONT="]having [/FONT]a play around I have come to a brick wall.
I have been able to get my splash screen up, then after that my Main Menu Form with the Access application hidden, but then when I click on any of my buttons to open other forms nothing.
After searching the internet and trying a number of things am lost.
On the forms am trying to open I have tested the following code;
Thanks for any help on this...
After coming across the below code and [FONT="]having [/FONT]a play around I have come to a brick wall.
I have been able to get my splash screen up, then after that my Main Menu Form with the Access application hidden, but then when I click on any of my buttons to open other forms nothing.
Code:
'************ Code Start **********
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Function fSetAccessWindow(nCmdShow As Long)
[B]'Usage Examples[/B]
[B]'Maximize window:[/B]
[B]' ?fSetAccessWindow(SW_SHOWMAXIMIZED)[/B]
[B]'Minimize window:[/B]
[B]' ?fSetAccessWindow(SW_SHOWMINIMIZED)[/B]
[B]'Hide window:[/B]
[B]' ?fSetAccessWindow(SW_HIDE)[/B]
[B]'Normal window:[/B]
[B]' ?fSetAccessWindow(SW_SHOWNORMAL)[/B]
[B]'[/B]
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm
If Err <> 0 Then [B]'no Activeform[/B]
If nCmdShow = SW_HIDE Then
MsgBox "Cannot hide Access unless " _
& "a form is on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
Else
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
End If
fSetAccessWindow = (loX <> 0)
End Function
[B]'************ Code End ********[/B]
On the forms am trying to open I have tested the following code;
Code:
Private Sub Form_Load()
Call fSetAccessWindow(SW_HIDE)
End Sub
Code:
Private Sub Form_Open(Cancel As Integer)
On Error GoTo ErrorPoint
Me.Visible = True
fSetAccessWindow (SW_HIDE)
ExitPoint:
Exit Sub
ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & err.Number _
& vbNewLine & "Error Description: " & err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint
End Sub