A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Validation Rule



 
 
Thread Tools Display Modes
  #1  
Old July 6th, 2004, 06:51 PM
Lonz
external usenet poster
 
Posts: n/a
Default Validation Rule

I created a bankruptcy data, using Case Number as the Primary Key. I now need to know how to disallow duplicate Case Numbers. The Case Numbers are 8 digits (e.g. 00-00000). Can any one assist me with setting up a Validation Rule for this.

Thanks
  #2  
Old July 6th, 2004, 07:02 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Validation Rule

If Case Number is the primary key, you will not be allowed to enter
duplicates.

--
Duane Hookom
MS Access MVP


"Lonz" wrote in message
...
I created a bankruptcy data, using Case Number as the Primary Key. I now

need to know how to disallow duplicate Case Numbers. The Case Numbers are 8
digits (e.g. 00-00000). Can any one assist me with setting up a Validation
Rule for this.

Thanks



  #3  
Old July 6th, 2004, 07:15 PM
Lonz
external usenet poster
 
Posts: n/a
Default Validation Rule

That's what I thought. However, it allowed me to enter a duplicate.

"Duane Hookom" wrote:

If Case Number is the primary key, you will not be allowed to enter
duplicates.

--
Duane Hookom
MS Access MVP


"Lonz" wrote in message
...
I created a bankruptcy data, using Case Number as the Primary Key. I now

need to know how to disallow duplicate Case Numbers. The Case Numbers are 8
digits (e.g. 00-00000). Can any one assist me with setting up a Validation
Rule for this.

Thanks




  #4  
Old July 6th, 2004, 07:17 PM
Lonz
external usenet poster
 
Posts: n/a
Default Validation Rule

The indexed field reads: Yes (No Duplicates)

"Duane Hookom" wrote:

If Case Number is the primary key, you will not be allowed to enter
duplicates.

--
Duane Hookom
MS Access MVP


"Lonz" wrote in message
...
I created a bankruptcy data, using Case Number as the Primary Key. I now

need to know how to disallow duplicate Case Numbers. The Case Numbers are 8
digits (e.g. 00-00000). Can any one assist me with setting up a Validation
Rule for this.

Thanks




  #5  
Old July 6th, 2004, 07:21 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Validation Rule

You can't enter duplicate values in a primary key unless you have a corrupt
table. You may be storing a value with and without the "-".

--
Duane Hookom
MS Access MVP


"Lonz" wrote in message
...
That's what I thought. However, it allowed me to enter a duplicate.

"Duane Hookom" wrote:

If Case Number is the primary key, you will not be allowed to enter
duplicates.

--
Duane Hookom
MS Access MVP


"Lonz" wrote in message
...
I created a bankruptcy data, using Case Number as the Primary Key. I

now
need to know how to disallow duplicate Case Numbers. The Case Numbers

are 8
digits (e.g. 00-00000). Can any one assist me with setting up a

Validation
Rule for this.

Thanks






  #6  
Old July 6th, 2004, 07:34 PM
John Vinson
external usenet poster
 
Posts: n/a
Default Validation Rule

On Tue, 6 Jul 2004 10:51:01 -0700, "Lonz"
wrote:

I created a bankruptcy data, using Case Number as the Primary Key. I now need to know how to disallow duplicate Case Numbers. The Case Numbers are 8 digits (e.g. 00-00000). Can any one assist me with setting up a Validation Rule for this.

Thanks


No validation rule is necessary to prevent duplicates - setting a
field as a Primary Key does this automatically.

To enforce the data format, you can use an Input Mask of

00-00000;0

to allow entry of only digits and a hyphen (the ;0 ensures that the
hyphen is actually stored in the table).

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public

  #7  
Old July 6th, 2004, 07:49 PM
Lonz
external usenet poster
 
Posts: n/a
Default Validation Rule

Thanks much.

"John Vinson" wrote:

On Tue, 6 Jul 2004 10:51:01 -0700, "Lonz"
wrote:

I created a bankruptcy data, using Case Number as the Primary Key. I now need to know how to disallow duplicate Case Numbers. The Case Numbers are 8 digits (e.g. 00-00000). Can any one assist me with setting up a Validation Rule for this.

Thanks


No validation rule is necessary to prevent duplicates - setting a
field as a Primary Key does this automatically.

To enforce the data format, you can use an Input Mask of

00-00000;0

to allow entry of only digits and a hyphen (the ;0 ensures that the
hyphen is actually stored in the table).

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Rule [email protected] Database Design 1 June 23rd, 2004 05:51 PM
HELP!!! Validation rule Chris Running & Setting Up Queries 4 June 1st, 2004 01:11 PM
HELP!!! Validation rule Chris Using Forms 7 June 1st, 2004 01:11 PM
Validation Rule Tom Database Design 3 May 18th, 2004 10:27 PM
Format cell using Validation rule DDM Worksheet Functions 5 May 3rd, 2004 10:17 PM


All times are GMT +1. The time now is 05:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.