Solved

options

Posted on 1998-06-14
2
163 Views
Last Modified: 2010-05-03
i have a form with two check boxes witch are both unchecked and i was wondering if possible how would i save these options on exit so if one or both are checked on exit  the form would start with the check boxes checked and if both where unchecked the form would start with the boxes unchecked
0
Comment
Question by:p400
2 Comments
 
LVL 4

Accepted Solution

by:
Chizl earned 50 total points
ID: 1463276
Save to registry..   If you go to http://www.karland.com/OurProducts/RegSet32/ and download the FREE OCX file, you then will be able to write, read, and delete registry entry with ease.

The call to make your entry would be like this:

Private Const REG_NONE = 0                       ' No value type
Private Const REG_SZ = 1                         ' Unicode nul terminated string
Private Const REG_EXPAND_SZ = 2                  ' Unicode nul terminated string
Private Const REG_BINARY = 3                     ' Free form binary
Private Const REG_DWORD = 4                      ' 32-bit number
Private Const REG_DWORD_LITTLE_ENDIAN = 4        ' 32-bit number (same as REG_DWORD)
Private Const REG_DWORD_BIG_ENDIAN = 5           ' 32-bit number
Private Const REG_LINK = 6                       ' Symbolic Link (unicode)
Private Const REG_MULTI_SZ = 7                   ' Multiple Unicode strings
Private Const REG_RESOURCE_LIST = 8              ' Resource list in the resource map
Private Const REG_FULL_RESOURCE_DESCRIPTOR = 9   ' Resource list in the hardware description
Private Const REG_RESOURCE_REQUIREMENTS_LIST = 10

Private Const HKEY_CLASSES_ROOT = &H80000000
Private Const HKEY_CURRENT_USER = &H80000001
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const HKEY_USERS = &H80000003
Private Const HKEY_PERFORMANCE_DATA = &H80000004
Private Const HKEY_CURRENT_CONFIG = &H80000005
Private Const HKEY_DYN_DATA = &H80000006

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    RegSettings1.CreateNewKey HKEY_LOCAL_MACHINE, "SOFTWARE\YOUR COMPANY NAME\Program Name"
    RegSettings1.SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\YOUR COMPANY NAME\Program Name", "CheckBox1", Check1.Value, REG_DWORD
    RegSettings1.SetKeyValue HKEY_LOCAL_MACHINE, "SOFTWARE\YOUR COMPANY NAME\Program Name", "CheckBox2", Check2.Value, REG_DWORD
End Sub

0
 

Author Comment

by:p400
ID: 1463277
thanks for the help
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question