Hello.
I have a table «Clients». In that table, among others, I have a field
«Chosen number». The client can chose this number. However this number cannot
be repeated.
In the table «Clients», the field «Chosen number» is set to be indexed (no
duplicates), but when I enter a repeated value, nothing happens... the table
doesn't assume the repeated value and that 's all.
What I wanted to do is that when a client chose a already chosen number by
another client, appears a message box saying «Number already chosen. Please
try another one.», and the client could try to enter a new value.
Is it possible to do this?
Thanks in advance.
Best regards.
Use DLookup() in the AfterUpdate event procedure of the control on the form
where the user enters the Chosen Number.
If it already exists, show a MsgBox.
For details on how to use DLookup(), see:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hello.
> I have a table «Clients». In that table, among others, I have a field
[quoted text clipped - 12 lines]
> Thanks in advance.
> Best regards.
acores - 06 May 2007 16:55 GMT
Thank you, Allen. It worked fine.
> Use DLookup() in the AfterUpdate event procedure of the control on the form
> where the user enters the Chosen Number.
[quoted text clipped - 22 lines]
> > Thanks in advance.
> > Best regards.