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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit & Add New Record on same form

Status
Not open for further replies.

steve3739

Programmer
Jul 5, 2002
32
US
(Using VFP 5.0)
I have a form (using optimist row buffering) that allows the user to edit records and then Save (using tableupdate) or Cancel (using tablerevert). That all works fine.

To add a record while in the same form, the user presses an ADD button which appends a record, which is then edited.

However, after adding, if the user changes his mind and cancels, we are left with a blank record in the database. It can of course be deleted, and then reused later on, but this seems kind of messy.

Is there a better, more elegant way of adding a new record? Any ideas greatly appreciated.

Thanks much.
 
HI steve

If you append a record, then allow it to be edited.. and then , if cancel.. do TABLEREVERT(). This will remove the appended blank record also.

HOwever, if you do a tableupdate() after the append blank.. then the orphan blank record stays in the table, if in case not completed.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thank you for your help. It turns out that TABLEREVERT() does remove the blank record, which is what I wanted to happen. Problem solved!

As you can guess, I'm new to VFP, and trying to unlearn the old FoxBase and FoxPro for DOS way of doing things.

Thanks Again,
Steve
 


As you can guess, I'm new to VFP, and trying to unlearn the old FoxBase and FoxPro for DOS way of doing things.

What ever you do don't unlearn the old FoxBase and FoxPro for DOS . Just use it as a base for the Object Oriented way of doing things.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top