The best way to do this is to create a unique index in your table.
Example: if you are booking rooms for a date, your Booking table will have:
BookingDate the date being booked.
RoomID unique code for the room.
To prevent duplicate bookings for the same room and date:
1. Open the Booking table in design view.
2. Open the Index box (View menu.)
3. Enter a name into the first column of the dialog, and the first field
beside it. In the lower pane, set Unique to Yes. On the next row of the
dialog, leave the name, blank, and choose the other field in the 2nd column.
Your dialog will now look something like this:
BookingdateRoomid BookingDate Ascending
RoomID Ascending
4. Save the changes.
Access won't allow duplicates now.
The other alternative is to cancel the BeforeUpdate event of the form if
there is a duplicate, but that is best reserved for cases where you want to
warn of a duplicate, but allow it to occur anyway.