Solved

VB, Access Data Save Problem

Posted on 2002-03-19
8
180 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
Technology Partners: 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!

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

733 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