Access Developer 24
Reservation System, Copy Record with Children
Developer 24 continues our study of Recordsets. We will build a reservation system that you can use to reserve an item, hotel room, etc. and it will handle conflict resolution (no two reservations on the same dates). Then we will learn the right way and the wrong way to copy a record along with it's dependent child records, for example an order and all of its detail items.
In Lesson 1, we will go back to the Rental History database that we build in Developer 23 and add a future reservation system to it. We'll be able to reserve an item (or tool, room, car, whatever) for a particular customer between two dates. We'll set some arbitrary rules for our fictitious company, such as the reservation must be in the future, but no more than 1 year in the future. It must be a minimum 1 day, but maximum 2 week rental. Finally, we'll check for conflict resolution so that two reservations don't overlap. This is the hard part!
In Lesson 2, we learn the wrong way to copy and paste a record along with its dependent child records, for example an order and its detail items. I show you the wrong way to give you a better appreciation for the right way which is coming in Lesson 3, but there are still some good topics covered in this lesson, for example how to delete a record and automatically delete the child records without using Cascade Deletes, which you lose in linked tables (no Referential Integrity).
In Lesson 3, we learn the right way to do the same thing we did in Lesson 2. We'll create a couple of recordsets to copy the order info and the detail items. We'll learn how to loop through the Fields Collection of a recordset so we don't have to manually copy each field at a time. This will "future proof" our code. If we add fields to the tables in the future, we don't have to worry about updating our code!
Enroll now so that you can watch these lessons, learn with us, post questions, and more.
Please feel free to post your questions or comments below. If you are not sure as to whether or not this product will meet your needs, I'd rather help you before you buy it. Remember, all sales are final. Thank you.
Subscribe to Access Developer 24
Get notifications when this page is updated