Using a check box called checkbtn1, how would I make the form it is on show at startup if the check box is checked?
Printable View
Using a check box called checkbtn1, how would I make the form it is on show at startup if the check box is checked?
I don't understand. If the checkbox is on the form that you don't want to show at startup, then how could they get it back? You could store the choice in the registry and check the value to see whether the form should be shown at startup.
It's a form that the user can access via the "help" menu. It's just a complicated help file, thats all.
You can save settings like this:
VB Code:
Private Sub Form_Unload(Cancel As Integer) SaveSetting "RegCust", "Startup", "Backup", strDate SaveSetting "RegCust", "Startup", "LastEntry", _ intLastEntry End Sub
and then use this to get the info back
Quote:
GetSetting Function
Returns a key setting value from an application's entry in the Windowsregistry.
Syntax
GetSetting(appname, section, key[, default])
The GetSetting function syntax has thesenamed arguments:
Part Description
appname Required.String expression containing the name of the application or project whose key setting is requested.
section Required. String expression containing the name of the section where the key setting is found.
key Required. String expression containing the name of the key setting to return.
default Optional.Expression containing the value to return if no value is set in the key setting. If omitted, default is assumed to be a zero-length string ("").
Remarks
If any of the items named in the GetSetting arguments do not exist, GetSetting returns the value of default.
I dont get it. Where does the checkbox thing come in?
Print the value of the checkbox into the registry when you unload the app, and then read it in before you show the form, to see if it should show or skip the form.
where does the checkbox value go?
This should be what you need.
VB Code:
Private Sub Form_Unload(Cancel As Integer) dim cVal as Boolean If check1.value= vbChecked then cVal = True ' Show the form next time Else cVal = False ' Don't show the form on StartUp Endif SaveSetting "MyApp", "Startup", "HelpForm", cVal End Sub