Error if the number is repeated

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Back
Top