Can I set it up so that a certain combination of fields can't contain the
same entries, on another record? e.g. a combination of
FirstName/LastName/address? Or FirstName/LastName/phone? Or
FirstName/LastName/email?
Or is it possible to allow this but to throw up an alert message? Warning
that this person is probably already in the database? TIA 9 14351
On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" <cj******@hemc.net>
wrote: Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or FirstName/LastName/email?
Yes. In table design, open the indexes Window, and add a new index. To
indicate that it is a single index with multiple fields, enter the fields on
consecutive rows, and leave the index name blank on all but the first row.
With the first row selected, set the Unique property to Yes.
Or is it possible to allow this but to throw up an alert message? Warning that this person is probably already in the database? TIA
Trap the Before Update event on the form, and do a search for existing records
with the same combination of values. I recommend using a parameter query for
the search, so you don't have to worry about checking for quote characters,
etc.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'd recommend making a Primary Key instead of a unique index (I know,
same animal, different name) since Primary Keys were meant to do that.
I usually use the Form_Error procedure to trap duplicate record
errors. I've also used the "check before saving" method to do some
fancy work arounds if the user is entering a duplicate record (tell
user the record already exists - asking if they want to see it -
reloading form w/ existing record if they say yes).
HTH,
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBP8T5uoechKqOuFEgEQL7nACeMpzzIbcY0FvEicB+rSOQkt nIPcYAn31+
veFAxqLW19tEEOPddyYCRful
=J/gd
-----END PGP SIGNATURE-----
Steve Jorgensen wrote: On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" <cj******@hemc.net> wrote:
Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or FirstName/LastName/email?
Yes. In table design, open the indexes Window, and add a new index. To indicate that it is a single index with multiple fields, enter the fields on consecutive rows, and leave the index name blank on all but the first row. With the first row selected, set the Unique property to Yes.
Or is it possible to allow this but to throw up an alert message? Warning that this person is probably already in the database? TIA
Trap the Before Update event on the form, and do a search for existing records with the same combination of values. I recommend using a parameter query for the search, so you don't have to worry about checking for quote characters, etc. no****@nospam.nospam (Steve Jorgensen) wrote in
<a2********************************@4ax.com>: On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" <cj******@hemc.net> wrote:
Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or FirstName/LastName/email?
Yes. In table design, open the indexes Window, and add a new index. To indicate that it is a single index with multiple fields, enter the fields on consecutive rows, and leave the index name blank on all but the first row. With the first row selected, set the Unique property to Yes.
Well, theoretically, that's a nice-sounding idea, but in reality,
you'll end up with Nulls in some of the fields, which means you
can't really have a unique index. Or is it possible to allow this but to throw up an alert message? Warning that this person is probably already in the database? TIA
Trap the Before Update event on the form, and do a search for existing records with the same combination of values. I recommend using a parameter query for the search, so you don't have to worry about checking for quote characters, etc.
I don't think this kind of thing can be accomplished with indexes
for people records. First off, addresses, phone numbers and email
addresses really oughtn't be stored in the same table as the name,
etc., so you wouldn't have that information available to you until
after you've created the person record. You can't have a unique
index on name, as there are plenty of cases where people share
exactly the same name.
I accomplish this by using an unbound form to add people. When you
enter the first name and last name, you have to click a CHECK FOR
DUPLICATES button before you the ADD>> button is actually enabled.
That reveals a subform that lists close matches (based on various
combinations of LIKE matches and Soundex and Soundex2 matches), and
allows you to look at the close matches and determine if they are
the same person. If so, there's a command button that abandons the
add and takes you to the selected duplicate record.
This works pretty well, but it is dependent on the users actually
reading what's onscreen.
But I don't know any other solution that would not prohibit valid
data entry.
I've been intending to package this up as a sample database for
ages, but just haven't had the time.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
I disagree because 95% of the time, the primary key should be an Autoincrement
field, though as you say, it doesn't matter much which one is the primary key,
and which one is a unique index.
On Wed, 26 Nov 2003 19:06:31 GMT, MGFoster <me@privacy.com> wrote: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'd recommend making a Primary Key instead of a unique index (I know, same animal, different name) since Primary Keys were meant to do that.
I usually use the Form_Error procedure to trap duplicate record errors. I've also used the "check before saving" method to do some fancy work arounds if the user is entering a duplicate record (tell user the record already exists - asking if they want to see it - reloading form w/ existing record if they say yes).
HTH,
MGFoster:::mgf Oakland, CA (USA) -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv
iQA/AwUBP8T5uoechKqOuFEgEQL7nACeMpzzIbcY0FvEicB+rSOQkt nIPcYAn31+ veFAxqLW19tEEOPddyYCRful =J/gd -----END PGP SIGNATURE-----
Steve Jorgensen wrote: On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" <cj******@hemc.net> wrote:
Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or FirstName/LastName/email?
Yes. In table design, open the indexes Window, and add a new index. To indicate that it is a single index with multiple fields, enter the fields on consecutive rows, and leave the index name blank on all but the first row. With the first row selected, set the Unique property to Yes.
Or is it possible to allow this but to throw up an alert message? Warning that this person is probably already in the database? TIA
Trap the Before Update event on the form, and do a search for existing records with the same combination of values. I recommend using a parameter query for the search, so you don't have to worry about checking for quote characters, etc.
On Wed, 26 Nov 2003 21:12:59 GMT, dX********@bway.net.invalid (David W.
Fenton) wrote: no****@nospam.nospam (Steve Jorgensen) wrote in <a2********************************@4ax.com>:
On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" <cj******@hemc.net> wrote:
Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or FirstName/LastName/email? Yes. In table design, open the indexes Window, and add a new index. To indicate that it is a single index with multiple fields, enter the fields on consecutive rows, and leave the index name blank on all but the first row. With the first row selected, set the Unique property to Yes.
Well, theoretically, that's a nice-sounding idea, but in reality, you'll end up with Nulls in some of the fields, which means you can't really have a unique index.
Doh - right - what he said.
I accomplish this by using an unbound form to add people. When you enter the first name and last name, you have to click a CHECK FOR DUPLICATES button before you the ADD>> button is actually enabled. That reveals a subform that lists close matches (based on various combinations of LIKE matches and Soundex and Soundex2 matches), and allows you to look at the close matches and determine if they are the same person. If so, there's a command button that abandons the add and takes you to the selected duplicate record.
This works pretty well, but it is dependent on the users actually reading what's onscreen.
I forgot about this when replying to the message originally, but a similar
idea I picked up from the spec for a system I did recently was that the add
and search screens are the same, and you can't do an add without first doing a
search that must include certain fields. When you then select the new record
option, the search values are filled in as the defaults for the new record.
I guess you could call it a "find-or-add" model.
My implementation of that model had a form split into 3 sections. A short top
section contains the search parameter controls and the "Find" button. The
bottom section is split left/right with the search results listbox on the
left, and an add/edit subform on the right. The listbox is based on a union
query with a <<New Record>> row added at the bottom. The subform uses the
listbox selection as its master link, and on after update of the listbox, the
AllowAdditions property of the subform is set to True of False depending on
whether the new record selection is chosen.
Could you enlighten me. OK I agree that addresses can well be held in an
address table, but what is the advantage of holding phone nos or email
addresses in another table, unless there is a possibility of multiple phones
or e-mail addresses. Unlikely with a Club other than a mobile and land line.
Phil
"David W. Fenton" <dX********@bway.net.invalid> wrote in message
news:94***************************@24.168.128.74.. . no****@nospam.nospam (Steve Jorgensen) wrote in <a2********************************@4ax.com>:
On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" <cj******@hemc.net> wrote:
Can I set it up so that a certain combination of fields can't contain the same entries, on another record? e.g. a combination of FirstName/LastName/address? Or FirstName/LastName/phone? Or FirstName/LastName/email?
Yes. In table design, open the indexes Window, and add a new index. To indicate that it is a single index with multiple fields, enter the fields on consecutive rows, and leave the index name blank on all but the first row. With the first row selected, set the Unique property to Yes.
Well, theoretically, that's a nice-sounding idea, but in reality, you'll end up with Nulls in some of the fields, which means you can't really have a unique index.
Or is it possible to allow this but to throw up an alert message? Warning that this person is probably already in the database? TIA
Trap the Before Update event on the form, and do a search for existing records with the same combination of values. I recommend using a parameter query for the search, so you don't have to worry about checking for quote characters, etc.
I don't think this kind of thing can be accomplished with indexes for people records. First off, addresses, phone numbers and email addresses really oughtn't be stored in the same table as the name, etc., so you wouldn't have that information available to you until after you've created the person record. You can't have a unique index on name, as there are plenty of cases where people share exactly the same name.
I accomplish this by using an unbound form to add people. When you enter the first name and last name, you have to click a CHECK FOR DUPLICATES button before you the ADD>> button is actually enabled. That reveals a subform that lists close matches (based on various combinations of LIKE matches and Soundex and Soundex2 matches), and allows you to look at the close matches and determine if they are the same person. If so, there's a command button that abandons the add and takes you to the selected duplicate record.
This works pretty well, but it is dependent on the users actually reading what's onscreen.
But I don't know any other solution that would not prohibit valid data entry.
I've been intending to package this up as a sample database for ages, but just haven't had the time.
-- David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
Actually, it is not unlikely with a club, especially these days.
On Wed, 26 Nov 2003 23:08:46 -0000, "Phil Stanton" <ph**@stantonfamily.co.uk>
wrote: Could you enlighten me. OK I agree that addresses can well be held in an address table, but what is the advantage of holding phone nos or email addresses in another table, unless there is a possibility of multiple phones or e-mail addresses. Unlikely with a Club other than a mobile and land line.
Phil
"David W. Fenton" <dX********@bway.net.invalid> wrote in message news:94***************************@24.168.128.74. .. no****@nospam.nospam (Steve Jorgensen) wrote in <a2********************************@4ax.com>:
>On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" ><cj******@hemc.net> wrote: > >>Can I set it up so that a certain combination of fields can't >>contain the same entries, on another record? e.g. a combination >>of FirstName/LastName/address? Or FirstName/LastName/phone? Or >>FirstName/LastName/email? > >Yes. In table design, open the indexes Window, and add a new >index. To indicate that it is a single index with multiple >fields, enter the fields on consecutive rows, and leave the index >name blank on all but the first row. With the first row selected, >set the Unique property to Yes.
Well, theoretically, that's a nice-sounding idea, but in reality, you'll end up with Nulls in some of the fields, which means you can't really have a unique index.
>>Or is it possible to allow this but to throw up an alert message? >>Warning that this person is probably already in the database? TIA > >Trap the Before Update event on the form, and do a search for >existing records with the same combination of values. I recommend >using a parameter query for the search, so you don't have to worry >about checking for quote characters, etc.
I don't think this kind of thing can be accomplished with indexes for people records. First off, addresses, phone numbers and email addresses really oughtn't be stored in the same table as the name, etc., so you wouldn't have that information available to you until after you've created the person record. You can't have a unique index on name, as there are plenty of cases where people share exactly the same name.
I accomplish this by using an unbound form to add people. When you enter the first name and last name, you have to click a CHECK FOR DUPLICATES button before you the ADD>> button is actually enabled. That reveals a subform that lists close matches (based on various combinations of LIKE matches and Soundex and Soundex2 matches), and allows you to look at the close matches and determine if they are the same person. If so, there's a command button that abandons the add and takes you to the selected duplicate record.
This works pretty well, but it is dependent on the users actually reading what's onscreen.
But I don't know any other solution that would not prohibit valid data entry.
I've been intending to package this up as a sample database for ages, but just haven't had the time.
-- David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc ph**@stantonfamily.co.uk (Phil Stanton) wrote in
<3f***********************@mercury.nildram.net>: Could you enlighten me. OK I agree that addresses can well be held in an address table, but what is the advantage of holding phone nos or email addresses in another table, unless there is a possibility of multiple phones or e-mail addresses. Unlikely with a Club other than a mobile and land line.
Ha, ha, ha, ha, ha, ha, ha, ha!!!!
Boy, that one had me laughing.
I've not had an app in years that didn't need (note that I store
email and phone in the same table):
Home
Home Fax
Mobile
Home Email
Work
Work 2
Work Fax
Work Email
Some add a second mobile number and a pager number.
That many phone fields onscreen takes up a lot of space. I utilize
an outer join to populate all the possibilities, as in this screen
shot: http://www.bway.net/~dfassoc/example...ontactInfo.jpg
I find that clients like to see the choices laid out for them
rather than to have to pick from a dropdown list. I also find that
the method used in Outlook, for instance, is difficult, because
most users will never notice that there are other types of numbers
that are recordable.
In that screenshot, there are two subforms, one for phones and one
for email. The phone types are categorized by Office or Phone in a
lookup table linked by PhoneTypeID. The subforms are filtered on
the PersonID and the tag of the subform object. That is, the
subform object for the home phones and home email form controls on
the parent form have a tag "Home" and is linked with:
LinkChildFields = "PhoneType"
The record source uses an outer join to a subquery that filters by
the PersonID of the parent form.
I use this kind of thing in all my apps these days. Adding a phone
type does not require much restructuring at all, just adding to the
phone types table and resizing the subform controls, which is a lot
easier than adding fields, changing recordsources and then finding
enough room for additional fields (though that's pretty much equal
between the two approaches if you lay it out right).
And every client that I've implemented this for has added at least
one phone type after the app was in production, precisely because
they knew it was possible without much trouble.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Actually, my design puts People, Addresses, and Comms in separate tables,
with junction tables between People/Addresses and People/Comms. I just sort
of took this for granted as the best way to do it. People with PO Box
mailing addresses need a second address for UPS or FedEx shipments. Also
some people have two homes. Re Comms - I'd have a lot of blank fields in
most People records if I tried to add a field for every possible CommType
like email, cellphone, home phone, work phone, etc.
"Phil Stanton" <ph**@stantonfamily.co.uk> wrote in message
news:3f***********************@mercury.nildram.net ... Could you enlighten me. OK I agree that addresses can well be held in an address table, but what is the advantage of holding phone nos or email addresses in another table, unless there is a possibility of multiple
phones or e-mail addresses. Unlikely with a Club other than a mobile and land
line. Phil
"David W. Fenton" <dX********@bway.net.invalid> wrote in message news:94***************************@24.168.128.74.. . no****@nospam.nospam (Steve Jorgensen) wrote in <a2********************************@4ax.com>:
On Wed, 26 Nov 2003 12:30:01 -0500, "Catherine Jo Morgan" <cj******@hemc.net> wrote:
>Can I set it up so that a certain combination of fields can't >contain the same entries, on another record? e.g. a combination >of FirstName/LastName/address? Or FirstName/LastName/phone? Or >FirstName/LastName/email?
Yes. In table design, open the indexes Window, and add a new index. To indicate that it is a single index with multiple fields, enter the fields on consecutive rows, and leave the index name blank on all but the first row. With the first row selected, set the Unique property to Yes.
Well, theoretically, that's a nice-sounding idea, but in reality, you'll end up with Nulls in some of the fields, which means you can't really have a unique index.
>Or is it possible to allow this but to throw up an alert message? >Warning that this person is probably already in the database? TIA
Trap the Before Update event on the form, and do a search for existing records with the same combination of values. I recommend using a parameter query for the search, so you don't have to worry about checking for quote characters, etc.
I don't think this kind of thing can be accomplished with indexes for people records. First off, addresses, phone numbers and email addresses really oughtn't be stored in the same table as the name, etc., so you wouldn't have that information available to you until after you've created the person record. You can't have a unique index on name, as there are plenty of cases where people share exactly the same name.
I accomplish this by using an unbound form to add people. When you enter the first name and last name, you have to click a CHECK FOR DUPLICATES button before you the ADD>> button is actually enabled. That reveals a subform that lists close matches (based on various combinations of LIKE matches and Soundex and Soundex2 matches), and allows you to look at the close matches and determine if they are the same person. If so, there's a command button that abandons the add and takes you to the selected duplicate record.
This works pretty well, but it is dependent on the users actually reading what's onscreen.
But I don't know any other solution that would not prohibit valid data entry.
I've been intending to package this up as a sample database for ages, but just haven't had the time.
-- David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: ColinWard |
last post by:
I am using the following code to validate that the person that is being
entered into the database does not already exist. However wnem I test it
by...
|
by: KT |
last post by:
Is there any one click solution that would do the trick? I would like
to create a button, so the person who maintains the database can
perform...
|
by: suffrinmick |
last post by:
Hi everyone!
I (Along with the help of some of you guys!) have managed to get a
query working which takes multiple values (types of organisation)...
|
by: Emilio Jimonerz |
last post by:
Hello. I am developing a project tracking database that records the
following information:
1. Project name
2. Lead person(s)
3. Support person(s)...
|
by: Iona |
last post by:
Hi Allan,
I'm using a nifty piece of code you put on here some time back to do a
duplicate entry check as below. I'm using to check for duplicate...
|
by: charliej2001 |
last post by:
Hi all
My access database has import/export capabiltiy of contact details
between outlook. The database is getting big now (1000+ contacts) and...
|
by: ariel81 |
last post by:
i have created a function to input data from four textboxes into a table. how do i prevent duplicate records of the same mth/Yr into the table?...
|
by: rgurganus |
last post by:
I'm trying to setup a way to find possible duplicate or near-duplicate
records of contact people. I have a table of 50k records doing an
inner...
|
by: jbrumbau |
last post by:
Hello,
I have been successfully using a database I've created for several months to populate an equipment list for a project we've been working...
|
by: tammygombez |
last post by:
Hey fellow JavaFX developers,
I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
|
by: tammygombez |
last post by:
Hey everyone!
I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
| |