• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

VB, Access Data Save Problem

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
pnc
Asked:
pnc
1 Solution
 
DennisLCommented:
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
 
mdouganCommented:
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
 
pncAuthor Commented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DennisLCommented:
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
 
KarcOriginCommented:
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
 
pncAuthor Commented:
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
 
pncAuthor Commented:
Thanks..

chakra
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now