Solved

static problems

Posted on 2003-11-14
5
180 Views
Last Modified: 2010-05-03
i have a form that will be used as a "options" form to a regular form.  The problem is, is that i cant get the checkboxes to stick when I click on them.  Once I close the form, the default values are restored

ive declared static values, and it still does not work for me.  any help would be lovely
0
Comment
Question by:bramsquad
  • 2
  • 2
5 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9750173
How are you saving the choices on a 'permanent' basis?  in a Database, in the Registry. in an external file?

AW
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 125 total points
ID: 9750202
Static variables only apply to t Sub or Function procedure, not the the full Form.

The use of a Static variable in a Sub is to preserve a value from one call to the Sub to the Next call to the same sub.
when you close the form, it is removed from memory, and re-created the next time, so anything that was part of the previous instance is gone, unlsess you have saved it somewhere outside of the code for the form itself.

This is a very common use of the Registry - using the two built-in VB routines GetSetting and SaveSetting.

Look up GetSetting in the VB Help system.

AW

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9750474
Other way could be not using static at all and place them in a bas file. It will be available throught the life of the application.
0
 
LVL 1

Expert Comment

by:fsaims
ID: 9753077
Add a module in your application, and declare variables in it, that could hold the value of check boxes. Those values will persistent during the life of your application.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9763369
fsaims, which is your move?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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
TT Auto Dashboard 13 95
Macro Excel - Multiple If conditions 2 82
how to Classify of email (pdf attachments) 7 45
Set WorkSheet  not Working 9 44
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 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…

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