SalisburyLad
Registered User.
- Local time
- Today, 07:08
- Joined
- Jun 12, 2010
- Messages
- 17
Hi All, I've been referring to this forum for a few years but never before needed to post but I cannot find a workable answer to a problem I have...
I have a database that collects information on building assets - asset number, description, location, age etc. We often have locations with similar assets so I am trying to create a form which takes data from a temporary table populated from the exiting data and queried by location - i.e. duplicate all assets in a given location. So far, so good. Now there may well be several assets in that new location so I have a form that displays a datasheet view of all the assets but leaves the asset number blank to allow a new unique asset number to be added. The aim is to run an append query to write these new assets to the existing table but.... I need to check, as each new asset number is entered, that it is a unique number (both in the original asset table and the temporary table I am editing). I do not want to get to the query only to find errors due to key violations! I've tried various bits of code using Dlookup() and Dcount() but as I am editing one record of many in the dataset I cannot seem to get either to look up the asset number in (queries referring to the two tables involved). Any advice gratefully received.
I have a database that collects information on building assets - asset number, description, location, age etc. We often have locations with similar assets so I am trying to create a form which takes data from a temporary table populated from the exiting data and queried by location - i.e. duplicate all assets in a given location. So far, so good. Now there may well be several assets in that new location so I have a form that displays a datasheet view of all the assets but leaves the asset number blank to allow a new unique asset number to be added. The aim is to run an append query to write these new assets to the existing table but.... I need to check, as each new asset number is entered, that it is a unique number (both in the original asset table and the temporary table I am editing). I do not want to get to the query only to find errors due to key violations! I've tried various bits of code using Dlookup() and Dcount() but as I am editing one record of many in the dataset I cannot seem to get either to look up the asset number in (queries referring to the two tables involved). Any advice gratefully received.