update

K

kkk

In a table i have 2 fields and 2 calculate fields with data of first fields.
2 calculate i obatin with a query.
Is possible update a form with 2 data of a query before close it ?
 
J

John Vinson

In a table i have 2 fields and 2 calculate fields with data of first fields.
2 calculate i obatin with a query.
Is possible update a form with 2 data of a query before close it ?

Do you want to display the fields on a Form? If so, just base the form
on the Query and set the control source of two textboxes to the names
of the calculated fields. Or do you want to store the calculated
values in some other table? If so, bear in mind:
Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
 
K

kkk

Now i tape data in a form, i close it , run query, and i can see my table
update through a form.
So i wish to see data of a query in a form , if possible, but to have all
data update in the same table where i tape firsts.
My table is [km] [time] [average km/h] [total progressive km]
 
J

John Vinson

Now i tape data in a form, i close it , run query, and i can see my table
update through a form.
So i wish to see data of a query in a form , if possible, but to have all
data update in the same table where i tape firsts.
My table is [km] [time] [average km/h] [total progressive km]
If you base the Form on a Query you should be able to update the Query
directly; this will update the Table. You don't need two separate
forms. If this is not happening please post the SQL view of the Form's
Recordsource query.
 
K

kkk

Excuse me but i don't undestand what i must do.
if i use wizard for create a form and set by table, i tape km and time but
when i close it, save in table only km and time, no mediac and km_totc
if i use wizard for create a form and set by query, when i open form i see
#error in mediac field until i tape km and time. now all my query form is
update,(close form) but in table i update only km and time again.
i desire update my table through insert form in one time, what i must do ?
this is my full query SELECT Test.ID, Test.Km, Test.Time,
[Km]/(CDbl([Time])*24) AS Mediac, CDbl(TotProgrQry("ID",[ID],"Km","Test"))
AS Km_Totc
FROM Test;



John Vinson said:
Now i tape data in a form, i close it , run query, and i can see my table
update through a form.
So i wish to see data of a query in a form , if possible, but to have all
data update in the same table where i tape firsts.
My table is [km] [time] [average km/h] [total progressive km]
If you base the Form on a Query you should be able to update the Query
directly; this will update the Table. You don't need two separate
forms. If this is not happening please post the SQL view of the Form's
Recordsource query.
 
J

John Vinson

Excuse me but i don't undestand what i must do.
if i use wizard for create a form and set by table, i tape km and time but
when i close it, save in table only km and time, no mediac and km_totc

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
 
K

kkk

All this is new for me, and this is the reason for which I have difficulty
to understand which the more elegant way and precise to realize the
database. with an example would have been simpler. if i can I send you the
database of example for tape correct way.
 
J

John Vinson

All this is new for me, and this is the reason for which I have difficulty
to understand which the more elegant way and precise to realize the
database. with an example would have been simpler. if i can I send you the
database of example for tape correct way.

You are already correctly calculating the values that you want to see,
on the form.

That is the correct way.

You can store only the 'real' information in your table, and use
calculations on a Form (as you are now doing), on a Report (done in
exactly the same way), or in a Query by typing the expression in a
vacant Field cell in your query. By using a Query you can sort or
search on the calculated field without storing it in your Table.

I'm sorry, but private EMail support is reserved for paying customers.
 
K

kkk

Thank you.

John Vinson said:
You are already correctly calculating the values that you want to see,
on the form.

That is the correct way.

You can store only the 'real' information in your table, and use
calculations on a Form (as you are now doing), on a Report (done in
exactly the same way), or in a Query by typing the expression in a
vacant Field cell in your query. By using a Query you can sort or
search on the calculated field without storing it in your Table.

I'm sorry, but private EMail support is reserved for paying customers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top