Solved

EASY - VB 6 Forms save

Posted on 2004-08-02
4
204 Views
Last Modified: 2010-08-05
Hello,

I have a problem with my VB 6 Project.

If i have a label on a form called 'theform' on a label called 'thelabel' that says "Hello" i can edit this by using code like ...

theform.thelabel = "Goodbye"

this works fine.  However, if i close my running project, and then start it back up again the labe has changed back to "Hello" and has not saved my changes.

I know in Access you have to edit a form in design mode for the changes to save, i dont think there is any kind of design mode in VB is there?

Does anyone know how i can save my changes to my vb form?

Thanks,

Daz
0
Comment
Question by:yo_daz_uk
  • 2
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 11693022
You can store the value in a file (xml, ini, ...).
When you start the program, you can load the value from that file and if you close your form, save the values back into the file.
0
 

Author Comment

by:yo_daz_uk
ID: 11693078
I thought about just getting it from a text file or even setting up a mini database for all my forms so they would be easy to change, however this seemed a bit excessive, for what i would think is a minor change.

I have only got 4 forms in the project!!!

Is there no simple save method or anything like that?  That would save it to the form some how?
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 30 total points
ID: 11693104
No there's no alternative. Each vb-form must be compiled before it can be used. When you change something to it, it means you'll have to recompile it.
So the only options there are is using a resource file (ini, xml, txt, ...) or like you mentioned a database.
0
 

Author Comment

by:yo_daz_uk
ID: 11693124
OK thanks
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

759 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

21 Experts available now in Live!

Get 1:1 Help Now