Display query result in a Control on a Form

C

curniac

Ok, let me try and explain this.

I have a table that keeps cost and payment information in different
fields.
fTotalCost, fPayment1, fPayment2, fPayment3. I have built a query to
get the Balance - obvioulsy the query subtracts the payments from the
total cost. The result of the query is an experssion value. How do I
get this to show in a text field control on my Access form?

The form is based off of a table and not the query. The query only does
the calulation.

Can anyone help?
 
J

John Vinson

Ok, let me try and explain this.

I have a table that keeps cost and payment information in different
fields.

Then you have an incorrectly designed table.
fTotalCost, fPayment1, fPayment2, fPayment3. I have built a query to
get the Balance - obvioulsy the query subtracts the payments from the
total cost. The result of the query is an experssion value. How do I
get this to show in a text field control on my Access form?

The form is based off of a table and not the query. The query only does
the calulation.

Can anyone help?

Rather than storing each payment in a different *field*, you should be
storing each payment in a different *record*. You have a one
(purchase) to many (payments) relationship - you need to model it as a
one to many relationship!

With correct table structure, a very simple Totals query will
calculate your balance.

John W. Vinson[MVP]
 
Top