wethumpback
New member
- Local time
- Today, 16:25
- Joined
- May 9, 2022
- Messages
- 6
I have a database to track assets. I have a form that contains the details of the assets such as the owner. I want to be able to change the owner, use an update query to log the EndDateTime (unassigning the asset), and then add a new insert for the newly assigned owner at the StartDateTime (assigning the asset). In general, I am trying to achieve a start and end date for the assets per owner to track the assignment history of each asset. Assets are not immediately reassigned so I have an owner labeled "Device Unassigned". This is fine, I'm okay with seeing the un-assigned period in the history of the asset as well.
I was trying to implement a before update to track the un-assignment and use an update query to fill the EndDate time, and then an after update event to insert a new set of data which initializes it as the StartDateTime with the newly assigned owner on the form.
I can't seem to use both in conjunction. Do you have any advice on a better way to handle this?
TLDR:
This is my current table, before update of Owner field send an update query to fill the EndDateTime of the assets assignment. After Update, insert a new piece of data using the newly assigned owner and filling in the StartDateTime field.
TBL_Assignment_History
ID | Item | Owner | StartDateTime | EndDateTime
** No primary key, since assets can be assigned and reassigned multiple times, I can handle displaying data separately... just wondering on how to go about tracking a start and end date based on when the owner field is updated.
I was trying to implement a before update to track the un-assignment and use an update query to fill the EndDate time, and then an after update event to insert a new set of data which initializes it as the StartDateTime with the newly assigned owner on the form.
I can't seem to use both in conjunction. Do you have any advice on a better way to handle this?
TLDR:
This is my current table, before update of Owner field send an update query to fill the EndDateTime of the assets assignment. After Update, insert a new piece of data using the newly assigned owner and filling in the StartDateTime field.
TBL_Assignment_History
ID | Item | Owner | StartDateTime | EndDateTime
** No primary key, since assets can be assigned and reassigned multiple times, I can handle displaying data separately... just wondering on how to go about tracking a start and end date based on when the owner field is updated.
Last edited: