Subject |
Re: Two Forms - Passing data |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Fri, 24 Oct 2014 09:01:03 +0200 |
Newsgroups |
dbase.getting-started |
Attachment(s) |
Unnamed File 1, Unnamed File 2, Unnamed File 3, Unnamed File 4, test_autoedit.wfm,
Unnamed File 6, Unnamed File 7, Unnamed File 8 |
|
| On Thu, 23 Oct 2014 20:43:17 +0200, edward racht <e.racht@gmail.com> wrote:
> Thank you
>
> I am looking at your recommendations since I have been reminded that the
> autoedit is there to lock the row.
Autoedit isn't there to lock a row, it's there to prevent a user from
inadvertently editing a rowset. It is the act of editing a rowset that
locks the row until the edit is complete or has been abandoned.
If you set a rowset's autoedit property false the user can't enter a value
into a datalinked control until the program has executed oRef.beginEdit()
or oRef.beginAppend().
Executing oRef.beginEdit() or oRef.beginAppend() effectively sets the
autoedit property true for the one transaction. As soon as the edit or
append has been completed, either by saving it or abandoning it, the
autoedit = false takes effect again.
While the user can't edit the rowset with autoedit set false without
executing oRef.beginEdit() this restriction doesn't apply to code in the
program. If your code writes a value to a datalinked control dBASE
executes oRef.beginEdit() for you whether autoedit is set false or not and
whether you like it or not. <g> This locks the record and writes to the
table. This is what was happening in your form.
The attached program shows this in action. You can't edit the data in the
grid but if you click the pushbutton one of the entries is overwritten
even though there is no oRef.beginEdit() in the code.
Mervyn.
|
|
|
|
|
|
|