| Subject |
Re: Calculated Field Question |
| From |
Andy Taylor <andy.taylor.1959@outlook.com> |
| Date |
Mon, 28 Nov 2022 12:53:17 +0000 |
| Newsgroups |
dbase.getting-started |
Hi Norman,
Calculated fields are no longer simply defined by a "set fields to"
command. They are now integrated within the rowset of a query.
I see from your code that you are still using m-> to refer to field
values which will not work unless you also have a table open in a workarea.
You are however, using rowsets which means that you are also using
queries with sql statments. You ain't half mixing things up! This is
itself is not a problem as long as you are clear what interacts with what.
I can probably suggest how you should go about things but you don't
really give enough detail. Do you calculate the values ftpmt and stpmt
or do they come from another table open in a workarea?
Andy
> I am trying to transfer and use the values of calculated fields ftpmt and stpmt which are generated in pushbutton1 for use in pushbutto2. The values check out OK at the end of pushbutton1, but at the beginning of pushbutton2 the values should be 997.95 and 0 but are an extraneous 5.11 and an inverted 997.95. The ftpmt and stpmt entryfields are included in the Table and data linked.
>
> The calculated fields are not shown as rows in the Table and apparently cannot be saved as I tried. They are shown on the Form as non enabled entryfields.
>
> I even tried Using m->ftpmt and m->stpmt stored as public variables temftpmt and temstprt in pushbotton1 to be retrieved for pushbutton2. This did not work, the results printed out a 0 0.
>
> End of Pushbutton1
>
> ? m->ftpmt, m->stpmt
>
> form.lqactsch1.rowset.fields["ftpmt"].value = m->ftpmt
> form.lqactsch1.rowset.SAVE()
> form.lqactsch1.rowset.fields["stpmt"].value = m->stpmt
> form.lqactsch1.rowset.SAVE()
> temftpmt = m->ftpmt
> temstpmt = m->stpmt
>
> RETURN
>
>
> Begin Pushbutton2
>
> Clear
> ? form.lqactsch1.rowset.fields["ftpmt"].value
> ? form.lqactsch1.rowset.fields["stpmt"].value
> m->ftpmt = temftpmt
> m->stpmt = temstpmt
> ? m->ftpmt, m->stpmt
>
> ? "PPPP"
> return
>
> Results after running Pushbutto2
>
> 5.10
> 997.95
> 0 0
> pppp
>
> It is obvious that I do not understand using calculated fields. Any comments would be appreciated. Norman
>
|
|