• ** There has been a recent site upgrade. Please clear your browser cache to avoid issues. **
  • New forum feature - post voting and best solution

    Check out this thread for the details: https://www.access-programmers.co.uk/forums/threads/new-forum-feature-post-voting-and-best-answer.314134/

    This new feature looks great to me! :)

  • We now have 3 forum themes

    Go for the default (light) theme, Shades of Grey or Shades of Blue. I just added the Blue one.

    The thread about it is here: https://www.access-programmers.co.uk/forums/threads/new-forum-theme-shades-of-blue.314136/

After update data macro trigger (1 Viewer)

saledo2000

Registered User.
Local time
Today, 21:55
Joined
Jan 21, 2013
Messages
94
Hi everyone,
I have a table tblCompound where is created named data macro which calculate time out of compound
in hours after I insert Exit date and time in frmCompound.
I would like to create after update data macro when customer is more then 48 hours out of compound
to set Departure date to Exit date in tblCustomer. Could you please help with this.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:55
Joined
Oct 29, 2018
Messages
12,624
Hi. Can you post a sample copy of your db?
 

NauticalGent

CopyPaster of the First Order
Local time
Today, 17:55
Joined
Apr 27, 2015
Messages
3,040
While DBG is waiting for your db to be posted, I have a observation. Named Data Macros, I'm pretty sure, are for table-level events that are triggered much like form events.

Although similar in concept, the time to use them differ. From your question, I get the impression that a Form AfterUpdate event, in this case the Departure Date, would be a better option?
 

saledo2000

Registered User.
Local time
Today, 21:55
Joined
Jan 21, 2013
Messages
94
Hi
Thank you for quick reply. Yes you are right but when I set Exit date once I want after 48 hours that data macro sets Departure automatically since I do not enter every day to check who is exceeded time out. This should happen automatically when I open database next time. Than his profile will be inactive which is set with the other procedure on a form. I wonder if you know how to set after update data macro with updated field in IF expression bigger than 48 hours on ExitTime filed.
 

NauticalGent

CopyPaster of the First Order
Local time
Today, 17:55
Joined
Apr 27, 2015
Messages
3,040
Thanks for the extra info. As DBG has asked, it would be much easier going forward to have a copy of your DB, can you post a copy?
 

saledo2000

Registered User.
Local time
Today, 21:55
Joined
Jan 21, 2013
Messages
94
Soory but cannot copy database from the server. It is a company policy but will give you some screenshots.
 

saledo2000

Registered User.
Local time
Today, 21:55
Joined
Jan 21, 2013
Messages
94

Attachments

  • DB_Screenshoot.jpg
    DB_Screenshoot.jpg
    37.4 KB · Views: 18

theDBguy

I’m here to help
Staff member
Local time
Today, 14:55
Joined
Oct 29, 2018
Messages
12,624
Hi
Thank you for quick reply. Yes you are right but when I set Exit date once I want after 48 hours that data macro sets Departure automatically since I do not enter every day to check who is exceeded time out. This should happen automatically when I open database next time. Than his profile will be inactive which is set with the other procedure on a form. I wonder if you know how to set after update data macro with updated field in IF expression bigger than 48 hours on ExitTime filed.
Okay, if you only want to calculate the dates when the app opens, you should be able to use an UPDATE query and execute it with an Autoexec macro.
 

Users who are viewing this thread

Top Bottom