I have a table (Equipment_tbl) where I have several fields, with the primary key being (Equipment ID). I have designed a query to find the last equipment ID added (newly added equipment ID).
I then want to append this newly added equipment ID to a compatibility matrix table which compares each piece of equipment against a station. The user can then fill in other details such as can it be used there, etc. There are ten stations held in the (stations_tbl) table and the compatibility table has an autonumber as its primary key.
The compatibility table consists of the following fields: Autonumber, Equipment ID, Station ID.
I have the append query working correctly, but before I run it (using a macro), I want to check that the newly added equipment ID does not already exist in the compatibility table.
I'm looking for something like an IF statement.
For example:
If (equipment ID field in the matrix table) = (the newly added equipment ID value) then do not run append query, else run append query.
Any help would be greatly appreciated. As I said, I have the append query working fine, I just need help to avoid it being run more than once and creating duplicate compatibilities.
I then want to append this newly added equipment ID to a compatibility matrix table which compares each piece of equipment against a station. The user can then fill in other details such as can it be used there, etc. There are ten stations held in the (stations_tbl) table and the compatibility table has an autonumber as its primary key.
The compatibility table consists of the following fields: Autonumber, Equipment ID, Station ID.
I have the append query working correctly, but before I run it (using a macro), I want to check that the newly added equipment ID does not already exist in the compatibility table.
I'm looking for something like an IF statement.
For example:
If (equipment ID field in the matrix table) = (the newly added equipment ID value) then do not run append query, else run append query.
Any help would be greatly appreciated. As I said, I have the append query working fine, I just need help to avoid it being run more than once and creating duplicate compatibilities.