Calculated Field?

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

I have two tables a Main Table and Detail table. I need to create a
calculated field that will produce the text "Open" or "Closed" based on
what it finds in the Detail table. The field Status contains text
that is Active, or Terminated. The other field is the status date.

What I need is for it to return is the following: If the last record in
the detail table for the client is Active to create Open in the
calculated field. If the last record for the client is not Active to
put Closed in the calculated field in the Main table.

I hope I explained this ok?
 
Randy

Define "last". How does Access know your definition?

Because the value of your ?!last?! Detail table row could change, you
probably don't want to create a calculated field in your Main table.
Instead, create a query that finds the "last" (hint: don't use the
aggregated "Last" - use Maximum or ...) Detail record for each Main record,
then use the value in that detail record in your query to set the text to
"Open" or "Closed".

Use the query to fill in this value on your forms and reports (hint: you ARE
using forms, not working directly in the tables, right?!).

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top