Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Buffer error trying to set a validation rule
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00624630
Message ID:
00624651
Views:
11
Matthew,

>
>I'm trying to use validation rules in the table designer to set a value for DateUpdated in a table that will also show in a textbox on the form. The DE buffering is set to 5, the form is set to 2

What do you mean my this last statement?

>
>In the field validation box I placed the following:
>
>dateupdate=IIF(TABLEUPDATE(.T.),TABLEREVERT(.T.),DATE())
>

Putting this code in the field validation rule will not set the value of dateUpdate. It will compare it to the right side of the expression, to determine whether or not the field is valid or not. IOW, the entire expression needs to return a boolean value.

With that in mind, you can put your tableupdate() code in a method of the form. Here is an overly simplified example:
save() method of form
if tableupdate(.t.)
    dateUpdate = date()
else
    * unable to update data
    * show a message to the user?
endif
>When I try to commit the change to the table I get the following error:
>
>Function requires row or table buffering mode
>
>Is the error telling me I have to set the buffering mode in the expression?
>
>Is this the way to do this, or is it even a way at all? I had hoped to at least see if was learning to code correctly, I hate it when you can't get the opportunity to screw up.
>

As far as I know, we always have that opportunity *grin*
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform