From the course: Access 2016 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Attaching data macros to tables

Attaching data macros to tables

From the course: Access 2016 Essential Training

Start my 1-month free trial

Attaching data macros to tables

- Data macros are macro-events that are triggered when something changes in a data table. They're most commonly used to essentially watch what gets entered into a table and then respond to the entry event by creating a log, noting the change that happened and recording the time and date when the change was made. Let's create a simple logging system to keep track of changes that are made to the Landon Hotel's room assignments. First, we need to create a table in order to store the log, so I'll go up to the Create tab and we'll start a new table in Design view. The first field is going to be LogId. And it's going to be a AutoNumber field, so I'll just type in "A" to get to AutoNumber. And then we'll come down here to the next one. And actually we'll change this to a capital D there and make it the Primary Key. Okay, we'll come down to the second one and it's going to be CheckInDate. This is going to be a Date/Time data type. Come down to the third field. We're going to say OldRoomID…

Contents