Solved

options

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 65
Using "ScreenUpdating" 6 73
Copy a row 12 64
VBA: loop recent folder and copy txt file. 8 36
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

821 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