I have a splash screen with a check box. The idea was to ask the user to tick this if they do not wish to see this again. The code I am using in the open and close properties of filed is:
Private Sub Form_Close()
On Error GoTo Form_Close_Err
If Forms!Splash_Screen!Check1 = False Then
CurrentDb().Properties("StartupForm") = "Contacts"
Else
CurrentDb().Properties("StartupForm") = "Splash_Screen"
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, _
"Splash_Screen")
db.Properties.Append prop
Resume Next
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo FormOpen_Err
If (CurrentDb().Properties("StartupForm") = "Splash_Screen" Or _
CurrentDb().Properties("StartupForm") = "Form.Splash_Screen") _
Then
Forms!Splash_Screen!HideSplash = False
Else
Forms!Splash_Screen!Check1 = True
End If
FormOpen_Exit:
Exit Sub
FormOpen_Err:
If Err = 3270 Then
Forms!Splash_Screen!Check1 = True
Resume FormOpen_Exit
End If
This doesn't seem to work. Any help or advice would be greatly appreciated.
Thanks
Private Sub Form_Close()
On Error GoTo Form_Close_Err
If Forms!Splash_Screen!Check1 = False Then
CurrentDb().Properties("StartupForm") = "Contacts"
Else
CurrentDb().Properties("StartupForm") = "Splash_Screen"
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, _
"Splash_Screen")
db.Properties.Append prop
Resume Next
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo FormOpen_Err
If (CurrentDb().Properties("StartupForm") = "Splash_Screen" Or _
CurrentDb().Properties("StartupForm") = "Form.Splash_Screen") _
Then
Forms!Splash_Screen!HideSplash = False
Else
Forms!Splash_Screen!Check1 = True
End If
FormOpen_Exit:
Exit Sub
FormOpen_Err:
If Err = 3270 Then
Forms!Splash_Screen!Check1 = True
Resume FormOpen_Exit
End If
This doesn't seem to work. Any help or advice would be greatly appreciated.
Thanks