Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Committing changes in VFP - using pessimestic ro bufferring
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Committing changes in VFP - using pessimestic ro bufferring
Miscellaneous
Thread ID:
00019449
Message ID:
00019449
Views:
78
I have a data entry form which adds records to a table that has the bufferring set to 2.

The cmd.Save.click code is as follows:

*************************************
* Class: IncBNS
* SAVE Button.CLICK
*
*************************************


if ValIncomingBNS()
RELEASE frmError
ELSE
RETURN
ENDIF

** if the followinng function returns .t., there is
** addtiional code for more calculations
** if if returns .f., it displays another form which
** lists the errors

here is the function:

*************************************
*
* valid1.prg
* Application: Wires Program
* Written by: Al Williams
* Last Modified: Jan. 17, 1997
*
************************************

FUNCTION ValIncomingBNS
pcMessage = ""

pcmessage = ""

IF EMPTY(IncomingBNS.receiving)
pcMessage = pcMessage + "Recieving Institution field is blank"+CHR(13)+CHR(10)
ENDIF


IF EMPTY(IncomingBNS.bene_last)
pcMessage = pcMessage + "Beneficiary Last Name field is blank"+CHR(13)+CHR(10)
ENDIF

IF EMPTY(IncomingBNS.by_ord_of)
pcMessage = pcMessage + "By Order Of field is blank"+CHR(13)+CHR(10)
ENDIF

IF EMPTY(IncomingBNS.amount)
pcMessage = pcMessage + "Amount field is blank"+CHR(13)+CHR(10)
ENDIF

IF LEN(pcMessage) = 0
RETURN .T.
ELSE

DO FORM error && display form with errors
ERROR.edtMessage.Value = pcMessage && add error message to control
RETURN .F.
ENDIF

** the problem is that as soon as the form is displayed,
** the record has alreay been updated
** if I take out the DO FORM section and just leave **RETURN .f., the changes are not committed and I
** can click on the CANCEL button which contains
** TABLEREVERT() and the changes are cancelled

Any ideas on why the table cahnges are committed as soon as I run the ERROR form?
Al Williams

Anola MB, CANADA
Next
Reply
Map
View

Click here to load this message in the networking platform