Home All Groups Group Topic Archive Search About

Check for Duplicate values in Access

Author
22 Oct 2005 9:07 PM
Fraser
Hi, I'm creating a database that needs to check a value in a text field =
=

called JobCreate in a form called frmJobCreated against a table called  =

tblJobCreated which has a whole list of job numbers in a field called  =

JobNo, then come back with a message telling the user if there is a  =

duplicate value...any help would be greatly appreciated,,thanks, Fraser

Author
22 Oct 2005 9:31 PM
ML
Please, post DDL, sample data, and specify expected results.

Are you trying to report duplicate values, prevent them from being inserted
or what?


ML
Author
22 Oct 2005 9:45 PM
Fraser Hetherington
Hi, sorry for my ignorance but I'm quite new at databases what is DDL?
I'm trying to tell the user that a job number is already created if they
enter a duplicate number in the form that is already held in another
table, so it will display a message box telling them this, thanks

*** Sent via Developersdex http://www.developersdex.com ***
Author
23 Oct 2005 7:24 AM
R.D
Hi
First of all, This is not the right forum because there is a dedicated forum
for access.
well. Use primary key (SOME THING LIKE SELECT COLUMN WHILE DESIGININGG AND
RIGHT CLICK SELECT PRIMARY KEY) in access on the column so that  it will 
prevent and throws an error. you can customise your error using VBA.

You have to use VBA because you are not using SQL SERVER 2000

--
Regards
R.D
--Knowledge gets doubled when shared


Show quote
"Fraser Hetherington" wrote:

> Hi, sorry for my ignorance but I'm quite new at databases what is DDL?
> I'm trying to tell the user that a job number is already created if they
> enter a duplicate number in the form that is already held in another
> table, so it will display a message box telling them this, thanks
>
> *** Sent via Developersdex http://www.developersdex.com ***
>
Author
23 Oct 2005 11:38 AM
ML
Why are you making your users think of unique values? Why would any user care
what number his job is given?

Use a column constraint and design a function that will automatically
generate unique values for the job column. You sound like a crappy ISP -
designed to serve millions of users, yet each of them must create his/her own
*globally unique* username in order to create a valid account. A total waste
of time.


ML
Author
23 Oct 2005 3:12 PM
Chris2
"Fraser" <frase***@tiscali.co.uk> wrote in message
news:op.sy2fmed6s8gdz1@acer64...
Hi, I'm creating a database that needs to check a value in a text
field
called JobCreate in a form called frmJobCreated against a table called
tblJobCreated which has a whole list of job numbers in a field called
JobNo, then come back with a message telling the user if there is a
duplicate value...any help would be greatly appreciated,,thanks,
Fraser

Fraser,

Pleaes try reposting your above message in *one* of the following
newsgroups:

comp.databases.ms-access
microsoft.public.access.forms
microsoft.public.access.formscoding


Sincerely,

Chris O.

AddThis Social Bookmark Button