Link to home
Start Free TrialLog in
Avatar of davetough
davetough

asked on

change message -you cannot go to specific record

Hello ,
i have a serial number field indexed as unique field-
if someone tries to enter duplicate serial number in a access form- a message displays- you cannot go to specific record-
is there anyway to change words in message to- serial number already exists?
thank you
Avatar of MINDSUPERB
MINDSUPERB
Flag of Kuwait image

Dave,

Is there any existing code that display the "you cannot go to specific record"? If there is, you may post it here, we just need to tweak it.

If there's none, you may use the code below:

If Dcount("SerialNumber","YourTable","[SerialNumber]='" & Nz(Me.SerialNumber,0) & "'")>1 Then
MsgBox "Serial number already exist."


Sincerely,
Ed
Avatar of davetough
davetough

ASKER

if you open database- open form button and then-
where you add record-
if you try to add a duplicate- it will give you message
thank you
EXample.mdb
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial