I am doing this program that has listboxes and 2 combos
Listbox 1: 1-3 Persons
Listbox2: 4-7 Persons
Combo1: 8-20
Combo2: 21-50


When I click on a number of persons the price is displayed...

But I need a way to change the prices so they must not be in the coding!!! and i need to save these values on closing of program so that they stay the same next time I open the program!!!

Pleaaaaaase HEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!!!!!!


Thank you...

When I click on a number of persons the price is displayed...

But I need a way to change the prices so they must not be in the coding!!!

What is 'they': the prices or the persons?

and i need to save these values on closing of program so that they stay the same next time I open the program!!!

The simplest way to save data without much overhead is to use the registry.
Use the following:

SaveSetting  "MyApp", "MySection", "MyKey", "MyValue"

Use GetSetting to retrieve the data.

You probably want to save the index value. On the form load event you can retrieve that Index Value using GetSetting and then set the Index value with that value. I'm assuming that you already have the prices saved in the list of your properties as well as the values for your combo boxes.

The simplest way to save data without much overhead is to use the registry. Use the following:

SaveSetting  "MyApp", "MySection", "MyKey", "MyValue"

Use GetSetting to retrieve the data.

What I need is to have a way to change the prices....

If this is what you said can you please post an example...?

Thank you for replying

or give example of what you mean by:

"MyApp", "MySection",MyKey","MyValue"

"MyApp", "MySection",MyKey","MyValue"

Try reading the MSDN documentation. Those are just names I made up. You have the freedom to make up your own.

Use regedt32 from the run command: Check the HKEY_CURRENT_USER section: Software/VB and VBA Program Settings

MyApp is a name you give to an application found in the VB and VBA Program settings section

MySection is the name of a sub folder of the Application Name

MyKey is a name you make up for a field

and MyValue is the actual value.

You can search the MSDN.com legacy section if you don't have your own MSDN CD's installed.

Ok thank you...

I think I understood

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.