Obtain an alert message

  • Thread starter Thread starter JohnB762 via AccessMonster.com
  • Start date Start date
J

JohnB762 via AccessMonster.com

Hello to everybody,
In a form I have a text box "Niche". For each "Niche" I can associate a max
of 50 Cells (or number).
How may I obtain an alert message if I type twice the same number for the
same "Niche".

Thanks for your help.
Kind regards
John
 
JohnB762 via AccessMonster.com said:
Hello to everybody,
In a form I have a text box "Niche". For each "Niche" I can associate
a max of 50 Cells (or number).
How may I obtain an alert message if I type twice the same number for
the same "Niche".

Presumably this is set up with an underlying table containing the fields
Niche and Cell, or something like that. If, in the table design, you
create a unique index on the combination of those two fields, then any
attempt to add two records with the same Niche and Cell will raise a
duplicate key error. The default message for this is maybe not the most
understandable, but you can trap that error (number 3022) in the form's
Error event and display your own message instead.
 
Back
Top