Re: Duplicate Records in tables
From: Randy (randyb_at_att.net.nots.pam)
Date: 11/10/04
- Next message: John Vinson: "Re: why should i use access over oracle, for a facilities management ."
- Previous message: Joseph: "How do I set up a task lists and followup dates in microsoft acce."
- In reply to: Infected04: "Duplicate Records in tables"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 03:41:48 GMT
Infected04 wrote:
> I need to disallow duplicate records entered for a number field BUT allow
> the number 0 to be duplicated
> only 0
> can this be done?
Infected04, Yes, there is a way, but it is not advisable, since there are
two (2) important draw-backs:
1) You will not be able to enforce data entry on the specified field at the
table-level.
2) There will be many considerations when handling updates and reading on
queries, forms, reports, exports, and any other operations involving the
field.
Since zero (0) is not an actual number, then proceed as follow:
Set the "Required" property of the number field to "No."
Set the "Default Value" property of the field to "Null."
Set the "Indexed" property of the number field to "Yes - No Duplicates."
This will allow your table to have many records, with non-zero numbers,
while preserving the rule of not allowing duplicates.
[Considerations for data entry:]
For a numbers (different than 0) update the field.
For the number zero (0) do not update, or update the field with Null
[Considerations for data update:]
For a new number (different than 0) update the field.
For the number zero (0) update the field with Null
[Considerations when dealing with the field on queries, textboxes, etc.:]
Convert the field to a number using a field calculation, like in :
Val(nz([Field1],""))
-Randy
- Next message: John Vinson: "Re: why should i use access over oracle, for a facilities management ."
- Previous message: Joseph: "How do I set up a task lists and followup dates in microsoft acce."
- In reply to: Infected04: "Duplicate Records in tables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|