|
-
Feb 4th, 2008, 01:53 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Duplicate entry alert
I am saving data to Access database via excel VBA through ADODB connection.
I have set Primary key for the field “Name of the person”. Now when a duplicate entry is being saved, it shows an error at line rs.update as Duplicate entry.
I want to put a message box alert through which user will be notified that the name is duplicate entry.
I used the following code:
On error goto endo:
‘
‘
Exit sub
Endo:
Msgbox “ Dupliate entry not allowed”
End sub
The problem is that for any type of error, it is showing the Msgbox “ Dupliate entry not allowed” so I want to make the code in such a way that this msgbox should appear only when there is a duplicate entry.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|