[Solved] Query to Pull Previous Record
I have a form that is used to book a new event for a client who is already in the database.
Within that form I have a subform that is based on a query which displays information from that client's previous event. I did this using a solution found in the following thread:
http://www.access-programmers.co.uk/forums/showthread.php?t=150368
It is based on pulling the second to last record that is related to the current client. It works perfectly when booking a new event that has taken place on a previous date. However, if the previous event occured on that same date (but at a previous time), it doesn't register.
I would prefer a query that would pull the record previous to the current one, instead of pulling the second to last record out of all that client's events.
Not only would this solve the time vs. date issue, it would also mean that if more events are booked, then a past event is opened in a form, the sub forms in that form will display the event just prior to the current record.
Does anyone have any suggestions?
I have a form that is used to book a new event for a client who is already in the database.
Within that form I have a subform that is based on a query which displays information from that client's previous event. I did this using a solution found in the following thread:
http://www.access-programmers.co.uk/forums/showthread.php?t=150368
It is based on pulling the second to last record that is related to the current client. It works perfectly when booking a new event that has taken place on a previous date. However, if the previous event occured on that same date (but at a previous time), it doesn't register.
I would prefer a query that would pull the record previous to the current one, instead of pulling the second to last record out of all that client's events.
Not only would this solve the time vs. date issue, it would also mean that if more events are booked, then a past event is opened in a form, the sub forms in that form will display the event just prior to the current record.
Does anyone have any suggestions?
Last edited: