"Don't show this screen again"

H

HServ

I want to make a welcome screen on my startup form, similar to the one in
the Northwind Database. I put some instructions on how to use my database
but the users won't want it to show after the first few times. I put a check
box on the form but it doesn't stay checked after I close the database. How
can I do this? Thanks
 
R

Rick Gittins

Are you saving the value of the check box some where like the database or
the registry?

Rick
 
H

huhong

HServ said:
I want to make a welcome screen on my startup form, similar to the one in
the Northwind Database. I put some instructions on how to use my database
but the users won't want it to show after the first few times. I put a check
box on the form but it doesn't stay checked after I close the database. How
can I do this? Thanks
 
H

huhong

HServ said:
I want to make a welcome screen on my startup form, similar to the one in
the Northwind Database. I put some instructions on how to use my database
but the users won't want it to show after the first few times. I put a check
box on the form but it doesn't stay checked after I close the database. How
can I do this? Thanks
 
H

HServ

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
 
T

Todd Shillam

Lee Li said:
try to erase the VB code.

Create a table to store a checkbox value. Have the form set to hidden by
default (place a checkbox control on the form bound to the table) then if
the checkbox is NOT check when the form opens, unhide the form. If the
checkbox is checked (remember its hidden by default), using the form's open
event, just close your splash form and open your menu (or switchboard).

Good luck,

Todd
 
Top