Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No-Duplicates Field with a default? 1

Status
Not open for further replies.

Xeseus

Technical User
Jan 16, 2007
35
US
I have a client who would like to, ideally, be able to have a field in a form that is required to be unique, yet is able to have a re-usable default value. For example, an I.D. field with a default option of "n/a". Now, of course, this is self-defeating and contradictory but I can think of at least one way to represent this sort of outcome in a report generated by a field on a form that is limited to unique values. For one, I could create a check box that could accompany the input field on the form that could be checked if "n/a" was to be outputted on the report, but this still requires that the data entry technician create a unique "dummy" ID number while adding the extra step of checking a box. Are there any other not-too-complicated alternatives to my solution?

 
In the table design view create an unique index (not allowing duplicates) ignoring null and be sure that the field allow null value but not empty string.
Then, for the report you'll use the Nz function:
Nz([your field], 'N/A')

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That sounds very cool! I will give that a try and let you know how it goes! Thanks PHV!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top