Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Buffering question.
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00049037
Message ID:
00049143
Views:
56
>>>>Can someone tell me why the following Buffering problem is occurring. In my forms DE I have set the BufferModeOverride=2 (Pessimistic Row Buffering) for the used cursor. If I APPEND BLANK and then issue a TABLEREVERT() the record doesn't go away.
>>>>
>>>>However, if I open the database from the command window and in its properties I Enable data buffering with Lock records set to When edited and Buffer set to Current record and then issue an APPEND BLANK and TABLEREVERT(), the APPENDED record goes away. Aren't these 2 situations the same and why doesn't TABLEREVERT() in my form seem to work properly.
>>>>
>>>>Thanx
>>>
>>>if (in your form) you have moved to a different record in the table before issuing the tablerevert(), the tablerevert won't recognize that you want to delete the record -- it will only revert any changes you've made since the record was 'saved'. when you move from record to record, you are implicitly saving the changes.
>>
>>Hi Dave,
>>
>>I haven't moved the record pointer. I have 2 buttons on my form called NewBtn and EditBtn. When the user presses NewBtn the NewBtn becomes Save and the EditBtn becomes Revert. The NewBtn.Click APPENDs a blank record and Enables the fields. If the user presses Revert it's .Click event fires the following code:
>>IF THIS.ToolTipText="Abort Adding Record" && In add mode
>> =TABLEREVERT() && Abort Adding
>> GOTO mnaddcurrecschedule && GOTO record before add
>> IF ! EOF()
>> THISFORM.UpdateDisplayFields && This IF sets the .Value
>> ELSE && property based on EOF()
>> THISFORM.NullDisplayFields
>> ENDIF
>>ENDIF
>>THISFORM.Refresh
>>
>>Any other ideas?
>
>what is the code in the add/save button?

The Add/Save button contains the following:
IF THIS.PARENT.Editbtn.ToolTipText="Edit Record" && Not in edit mode
mnaddcurrecschedule=RECNO()
APPEND BLANK
THISFORM.NullDisplayFields
THISFORM.Refresh
ELSE
Below the ELSE is the code for saving. I'm assuming you needed to see only the Add portion. In a nutshell, if you need to know, it ensures required fields are filled in, does a TABLEUPDATE and disables the fields.
ENDIF
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform