Solved

static problems

Posted on 2003-11-14
5
179 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 55
MS Access - Capture pressed key onclick 4 33
bit defender blocks good applications 2 94
Can we place a tooltip on the actual vb6 form 5 42
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

770 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