Show Total in Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Two text boxes in a form with control source =[DT End]-[DT Start] gives me
the correct answer in the Total box on the form which is a TIME but when i
run a query i get a blank or 0 in the total column.

Please help.
 
The textbox is a Calculated Control, it is NOT bound to the recordset. The
result of the equation is not being stored, nor should it be. To get the
same result in a query, you need to create a calculated field in the query.

Example:
Using the query design grid, try the following in the Field Name box:
ElapsedTime:[DT End]-[DT Start]

This will create a field called ElapsedTime when you run the query. This
field will display the calculated value. There are times it is better to do
this in the query then bind the textbox on the form to this field (i.e.
ElapsedTime) instead of doing the calculation in the form. It depends on
what you're trying to do. If all you need is to display the value, then
doing it in the form is sufficient.
 
Back
Top