|
-
Nov 3rd, 2007, 11:29 PM
#1
Thread Starter
Lively Member
Saving problem...
I got a text box with a number in it (i.e. 271).
When the user clicks a command button +1 is added to the number in the text box (i.e. 272), and the program closes.
When I load up the program again the number is the same (i.e. 271).
How do I make it save the new number so once the user loads up the program again its 272 and not 271, 273 and not 274, etc...
-
Nov 3rd, 2007, 11:34 PM
#2
Frenzied Member
Re: Saving problem...
From where does the initaila value (271) come from?
Where do you save this value? DB, File , Registry?
Please post some code also.
-
Nov 4th, 2007, 12:17 AM
#3
Re: Saving problem...
You need to write out the textbox contents upon program close. Write it to either the registry, ini file or a textfile. Then upon opening of your app you read the location and populate your textbox.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 4th, 2007, 12:55 AM
#4
Thread Starter
Lively Member
Re: Saving problem...
The initial number is in a text box.
I'm planning on saving it into a .txt file. But how can it just save the latest number into the .txt file then once its opened it opens the .txt file with the number.
While typing all this I think i figured it out
-
Nov 4th, 2007, 01:52 AM
#5
Re: Saving problem...
yes, you typed the answer
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Nov 4th, 2007, 10:22 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|