how do I get a "Last serviced" to add 6 weeks in "Next service" i.

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

Guest

I can't get my data (next serv) to update from the (last serviced) date If my
(maint) field is Yes. Any help on the argument would be helpful.
 
If a service is *always* exactly 6 weeks from the last service, you can do
this with a subquery or DMax() expression that gets the maximum service date
for the thing and uses DateAdd() to add 5 weeks.

If you need to be able to modify the value some it's not always 6 weeks, or
if some things need servicing more/less often, then you could use the
AfterUpdate and AfterDelConfirm events of the form where these entries are
made to execute an Append or Update query to add the new "service due"
record.
 
I can't get my data (next serv) to update from the (last serviced) date If my
(maint) field is Yes. Any help on the argument would be helpful.

The Next Service field probably *should not exist*, since it can be
calculated on demand any time:

NextService: IIF([Maint], DateAdd("ww", 6, [Last Serviced]), Null)

If you wish to store it (perhaps the 6 weeks is a suggested default
which you may want to edit), you can use the same expression in an
Update query or in the BeforeUpdate event of the Form you're using to
enter the data.

John W. Vinson[MVP]
 

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

Back
Top