| Subject |
Re: replace command |
| From |
Mervyn Bick <invalid@invalid.invalid> |
| Date |
Sat, 1 May 2021 10:44:52 +0200 |
| Newsgroups |
dbase.getting-started |
On 2021/05/01 09:28, Gaetano D. wrote:
> That being said, I am not sure that the entryfield knows about the
> "form" object. You can try this:
>
>
> this.rowset = this.clients1.rowset
>
> function ENTRYFIELD3_onChange()
> if form.entryfield3.value=0.00
> form.rowset.fields["cc"].value ="CASH"
> form.rowset.save()
> endif
> return
> >
> but I think you need to use the "parent" hierarchy to get to the form's
> rowset:
>
If any event handler for entryfield3 did not understand the concept of
"form" Aghostino's problem would be that dBASE was giving an error. As
the problem is that the code doesn't do what he needs we can assume that
"form" is not the problem.
One can use the "parent" hierarchy at any time but the only time one
must use it (Who's my daddy? :-) ) is in event handlers for queries on
forms and their associated rowset and field objects as well as for timer
object event handlers. The event handlers for any other objects
properly constructed on a form understand "form".
Aghostino, while Gaetano has shown you the OODML code to place a value
in a field in the table this will only work if entryfield3's onChange
event handler is executed.
Entryfield3's onChange event will only be triggered if the user (not the
program) changes the entryfield3.value property and then moves focus to
a different object. If the user doesn't actually trigger the event you
will need to include code to do this. Where you place this depends on
the rest of you code so I can't make a suggestion here.
form.entryfield3.onChange()
or
:class:entryfield3.onChange()
Mervyn.
|
|