Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving a table one record at a time

Status
Not open for further replies.

Alexengland1

IS-IT--Management
Joined
Mar 18, 2004
Messages
88
Location
US
I have created a form for data entry/modification and have gotten a request to make the form save each record to the database one at a time. They save needs to take place with no user intervention. I've tried using various save statements but nothing seems to work. Any help would be appreciated. Thanks.
 
Alex,
No matter want you do, you need to decide on what "triggers" the Save. Is it leaving a specific field? (Use the LostFocus() method.) What happens if the data is incomplete? Do you supply the primary key? (Otherwise they could simply click in an out of this "trigger" field and you'd end up with a lot of duplicate records.)

You're probably going to get and supply more information before a definitive approach can be suggested.

Rick
 
What this form is for is for Document image filing. So the document location is in the table already, all I need them to do is to select the client, tell me what type of document it is and insert any comments they might have. SO the chance for duplicate entries are slim. They want it to save each record as they move forward, so I figured I would put the trigger on the "Next" button.


You will have to excuse me, I'm a very rusty programmer, I haven't written code for a number of years and its taking me a while to get back into it.
 
Alex,

Are you using buffering?

If not, the record will be saved automatically as soon as the user enters the details and moves off the record. That's also true if you are using row buffering. If you are using table buffering, you need to call TableUpdate(0,.T.) to save the record. You can put that in the Click of the Next button.

You might also want to think about giving the user a way to cancel a record. They might start entering the data, then change their mind, before they move off the record. If you are using either row or table buffering, you can achieve that by calling TableRevert().

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top