calling function, need to save reults to the table

  • Thread starter Thread starter woody
  • Start date Start date
W

woody

I am calling a function that calculates the difference in days based on
2 dates entered in a table. I am doing the call from a txtbox in the
form that displays the data. It correctly displays the results in the
textbox, but I want to have it update the [EstDuration] field in the
'WorkOrders' table also.

here is the call I am using

=Work_Days([DateReceived],[ActDateEnd])

Any help will be appreciated.

Thanks Sarconastic
 
you should not save a calculated value to a table (unless
you need to be able to edit it) as it can always be calculated

remove the EstDuration field from your table structure and
simpy use the calculated value whenever you need to see that
information

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
The reason I need to save the result is so I can use it in displaying
information for a reporting agency. We are governed by a state agency,
and they say we have to be able to show the average turn around time
for all of our work orders. We do this by printing the work order
'completed list. But I need to add the number of days the work order
was open and be able to use this to average all the numbers.

Can I call this funtion in a query and be able to at least report it
and print it. Or call it in a report?

Thanks
Sarconastic
 
I figured it out, I think, I added the Function call as an expression
in a query I did and it did what I wanted for now. Now I just have to
add the averaging to the report data.

Thanks for your help

Sarconastic
 
The reason I need to save the result is so I can use it in displaying
information for a reporting agency. We are governed by a state agency,
and they say we have to be able to show the average turn around time
for all of our work orders. We do this by printing the work order
'completed list. But I need to add the number of days the work order
was open and be able to use this to average all the numbers.

Can I call this funtion in a query and be able to at least report it
and print it. Or call it in a report?

Thanks
Sarconastic

re: Can I call this funtion in a query and be able to at least report
it and print it. Or call it in a report?

Certainly you can. That is the correct way to do it.
You already have the expression to use.
In an unbound control on your report:
=Work_Days([DateReceived],[ActDateEnd])

In a query, add a new column:
EstDuration:Work_Days([DateReceived],[ActDateEnd])

No need to save this calculaton.
 
Back
Top