?
Solved

VB, Access Data Save Problem

Posted on 2002-03-19
8
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 5

Accepted Solution

by:
KarcOrigin earned 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

765 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