Hello,
I'm experiencing a slight difficulty with a Splash Screen I am trying to create for
Microsoft Access, when it starts up, when you click on Lable Close I get an error message
reading 'Compile error: User-defined type not defined', this appears at the prompt in the
code I've highlighted in
Bold. Any help with this is very much received, I've
gotten the code from an internet site that helps you design a Splash Screen. Many
Thanks.
The Code:
CODE
Option Compare Database
Option Explicit
Private Sub chkShowHide_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Form_Current()
End Sub
Private Sub lblClose_Click()
On Error GoTo Err_lblClose_Click
' Close the splash screen &
' Open the main database form, frmClients
DoCmd.Close
DoCmd.OpenForm "frmClients"
Exit_lblClose_Click:
Exit Sub
Err_lblClose_Click:
MsgBox Err.Description
Resume Exit_lblClose_Click
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo FormOpen_Err
If (CurrentDb().Properties("StartupForm") = "frmSplashScreen" Or _
CurrentDb().Properties("StartupForm") = "Form.frmSplashScreen") Then
Forms!frmSplashScreen!chkHideSplash = False
Else
Forms!frmSplashScreen!chkShowHide = True
End If
FormOpen_Exit:
Exit Sub
FormOpen_Err:
If Err = 3270 Then
Forms!frmSplashScreen!chkShowHide = True
Resume FormOpen_Exit
End If
End Sub
Private Sub Form_Close()
On Error GoTo Form_Close_Err
If Forms!frmSplashScreen!chkShowHide Then
CurrentDb().Properties("StartupForm") = "frmClients"
Else
CurrentDb().Properties("StartupForm") = "frmSplashScreen"
End If
Exit Sub
Form_Close_Err:
If Err = 3270 Then
Dim db As DAO.Database
Dim prop As DAO.Property
Set db = CurrentDb()
Set prop = db.CreateProperty("StartupForm", dbText, "frmSplashScreen")
db.Properties.Append prop
Resume Next
End If
End Sub