Solved

VB, Access Data Save Problem

Posted on 2002-03-19
8
176 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now