Preventing Duplicate Addresses

M

Miles

I have an Access database where there are several tables that all connect to
the same address table. On the forms where the user can input an address, I
am thinking of putting a command button. Essentially, the button would send
the user to a search form to see if the address is already in the database.
If it is, then the user does not have to retype in the address.

My question is if the address already exists in the database, how do I get
the existing address to link to another record? Also, is this the best way
for the user to see if the address already exists in the database (it seems
very complicated to use DLookUp for addresses because of all the potential
input variations for a single address).

Many thanks
Miles.
 
D

Damian S

Hi Miles,

Having a search form that allows searching of addresses for inputing is a
good idea if that's how you have your tables structured.

Have some code behind the selection form that populates the AddressID field
(or whatever you have) on your form that you called the Address Search screen
from. If you have multiple forms where you can call this from, pass a
parameter to indicate which form it's from (I like to use me.name to get the
form name) and use a select statement to work it out when it's time to pass
the ID back.

Hope that points you in the right direction.

Damian.
 
Top