Solved

options

Posted on 1998-06-14
2
161 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now