To save data to your program using My.Settings. To do this go to your program's properties and to Settings. Create your variables there and to access them, here's an example:

dim FavNumA as string
FavNumA = 5
My.Settings.FavNumB = FavNumA
My.Settings.Save
FavNumA=3
MsgBox (FavNumA)
MsgBox(FavNumB)

You will get a first message box that says "3" and a second one saying "5". You can check the Save My.Settings on exit in your programs properties. This will save My.Settings on exit so if you need the data saved before you exit, just use the My.Settings.Save sub.

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.