John J. Mihaljevic wrote:
> Hi all,
>
> Please excuse what's surely a very basic question, but I've been reading
> about buffering, tableupdate(), tablerevert(), etc., but am not finding an
> answer to this one.
>
> Using VFP 9, I have a simple data entry form with BufferMode=2 (Optimistic).
> In the properties for the table that I'm editing with the form, I've got
> BufferModeOverride=1 (Use Form Setting).
>
> Two of the buttons on my form are ADD and EDIT.  If my user choses EDIT, I
> can easily use TABLEUPDATE or TABLEREVERT to either save or ignore the
> changes.  No problems there.  But when my user chooses ADD, I'm doing an
> APPEND BLANK to give them a blank record to work with.  If they wanna save
> those changes, again, no problem with TABLEUPDATE if they click my SAVE
> button.  But what if they change their mind about adding that record?  How
> do I prevent that blank record from being added to the table if they click
> my IGNORE button?  I don't want my table to have blank records in it.
>
> Thanks very much!
>   

John,

You might want to download my source code from my VFP n-tier "open 
source" project here:  http://tinyurl.com/yaqw5e

You'll see that I use object references for controlsources instead of 
cursor fields.  Then, if the "record" is valid, I insert the object into 
the record via a GATHER NAME command.   Works great, and you don't have 
to worry about the tablerevert/tableupdate for new record adds!  As for 
edits, it works great for those too--user wants to save his changes, use 
the same GATHER command...use wants to revert....fine...don't do the 
GATHER.  You could essentially bypass buffering altogether with this 
design.  (Of course, this is great for "One-record" scenarios; for 
grids, you'd have to do something else or some clever tricks.)

hth,
--Michael

-- 
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to