


=.Ĭomment Block: If we reached this point, we already have a record Have the same vendor recorded more than once for a specific weekday.Ĭheck values going in against saved values. The data macro logic is as follows: Comment Block: Check for composite key violation. We cannot enforce this restriction in web tables unless we use a data macro in the BeforeĬhange event to check the combination of both the VendorID and the WeekDayID fields forĭuplicates before committing new or changed data to the table. The week more than once for the same vendor if we did, we would have repeating records. We don't want users of the database to accidentally enter the same delivery day of More than once during any week, but each vendor delivers only once on the specific deliveryĭay. We closed the Action Catalog so you could see more of the macro design surface.Įach vendor that delivers products to the restaurant using this database usually delivers Table Tools, and then click the Before Change button in the Before Events group to open Open the tblVendorDeliveryDays in Datasheet view, click the Table contextual tab under Several of the web tables use this technique to prevent duplicates across multiple fields.
#MICROSOFT ACCESS 2013 TUTORIAL 3 VENDOR SOFTWARE#
In the Back Office Software System sample web database data copy (BOSSDataCopy.accdb), Unnecessary because you can create multiple-field indexes in client tables.) (Note that you can also do the same for client tables however, it's You can create a data macro attached to a Before Change event that checks for duplicatesĪcross multiple fields. To work around this limitation for web tables, Nor do they support multiple-field indexes.

Web tables do not support primary keys other than the ID field, Uniqueness across multiple fields in a record instead of on just one field. Primary keys and multiplefield indexes in client tables to create composite keys. Preventing Duplicate Records Across Multiple Fields
