Here is the VB code for my startup form ("Splash"), which has a "Don't show
this screen again" check box that doesn't seem to work. I don't have any
expressions attached to my form properties, which may be a problem. Any
suggestions? Thanks
Option Compare Database
Option Explicit
' Functions in this module are used in the Splash form.
Function OpenStartup() As Boolean
' Displays Startup form
' Used in OnOpen property of Startup form.
On Error GoTo OpenStartup_Err
' Display Splash form.
' Set the value of HideStartupForm check box using the value of
' StartupForm property of database (as set in code or in
' the Disply Form/Page box in the Startup dialog box).
' Set the value of HideStartupForm check box using the value of
' StartupForm property of database (as set in Display Form box
' in Startup dialog box).
If (CurrentDb().Properties("StartupForm") = "Splash" Or _
CurrentDb().Properties("StartupForm") = "Form.Splash") Then
' StartupForm property is set to Splash, so clear
HideStartupForm
' check box.
Forms!Startup!HideStartupForm = False
Else
' StartupForm property is not set to Startup, so check
HideStartupForm
' checkbox.
Forms!Startup!HideStartupForm = True
End If
End If
OpenStartup_Exit:
Exit Function
OpenStartup_Err:
Const conPropertyNotFound = 3270
If Err = conPropertyNotFound Then
Forms!Startup!HideStartupForm = True
Resume OpenStartup_Exit
End If
End Function
End Function
Function HideStartupForm()
On Error GoTo HideStartupForm_Err
' Uses the value of HideStartupForm check box to determine the setting for
' StartupForm property of database. (The setting is displayed in Display
Form
' box in Startup dialog box).
' Used in OnClose property of Splash form.
If Forms!Splash!HideStartupForm Then
' HideStartupForm check box is checked so set StartupForm property to
Switchboard.
CurrentDb().Properties("StartupForm") = "Switchboard"
Else
' HideStartupForm check box is cleared, so set StartupForm property to
Splash.
CurrentDb().Properties("StartupForm") = "Splash"
End If
Exit Function
HideStartupForm_Err:
Const conPropertyNotFound = 3270
If Err = conPropertyNotFound Then
Dim db As DAO.Database
Dim prop As DAO.Property
Set db = CurrentDb()
Set prop = db.CreateProperty("StartupForm", dbText, "Splash")
db.Properties.Append prop
Resume Next
End If
End Function
Function CloseForm()
' Closes Startup form.
' Used in OnClick property of OK command button on Splash form.
DoCmd.Close
DoCmd.OpenForm ("Switchboard")
End Function