Solved

VB, Access Data Save Problem

Posted on 2002-03-19
8
178 Views
Last Modified: 2010-05-03
Hi All,

I am working on VB,Access 2000 database.The application contains a form with text fields.All the text fields are mandatory fields. When ever user click the save button it will save into the database.
My question is suppose the user enters some data & user want to exit from the application. The application should save only user entered data. How i can save only that data. So when ever user try to enter again same the user will continue the data from where he stoped.

So what is the best method i can follow.

pnc
0
Comment
Question by:pnc
8 Comments
 
LVL 3

Expert Comment

by:DennisL
ID: 6880053
If it is mandatory to save those fields then you won't be able to store the data in the Access database.  You would need to save it to some external resource, like a text file or registry, etc.

Then when you run the program again, load the textfile.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6880137
You have the option of changing the definition of the fields in the database to allow nulls, in which case, when the user exits the system, you update the record with whatever fields have been filled in, and set the other fields to null, then, the next time they come in, display the fields and let them continue.  Whenever they click on the save button, you can validate that all of the fields have been entered.  However, it wont take long for them to figure out that they can save a partial record just by exiting the system.  So, it's not the best solution.

Personally, my feeling is that if a user enters partial data, and you really need complete data before they can save a record, then just warn them that they are about to lose the data they have entered and give them a chance to complete the data entry or exit and lose their data.
0
 

Author Comment

by:pnc
ID: 6880198
hi DennisL,

I think saving partial data using external resource link Text file or registry.

Do you know where i can find the logic.

pnc
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 3

Expert Comment

by:DennisL
ID: 6880413
as for the registry, look up GetSetting and SaveSetting.  They're very easy to use.
As for textfiles.  there's a few ways to do this.  The simplest is probably using "Open".  Just look that up.

You should however take mdougan's comment he had in his last paragraph into account.  A lot easier to program, and most users will understand that closing a form will result in data not being saved (if they haven't saved already).
0
 
LVL 3

Expert Comment

by:DennisL
ID: 6880423
0
 
LVL 5

Accepted Solution

by:
KarcOrigin earned 250 total points
ID: 6880476
Dear pnc,
Can I comeup with one more solution. I am afraid if you like it. Since you are using the Access database why don't you use a temporary table. Store the data in that table and trasfer the data to the actual table only after the user clicks the Save button. By doing this you don't have to play with any Registry or text file. Moreover if the user enters the partial data and come again to the same screen you can read from this temporary table and display the data as he left.

I hope it helps you.

Thanks!
0
 

Author Comment

by:pnc
ID: 6921312
Thanks for your advice, even i got the same idea but i am not sure whether it is right way of doing. I got the solution.

chakra
0
 

Author Comment

by:pnc
ID: 6921317
Thanks..

chakra
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 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