Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

Inserting a Duplicate Record

Question:
When creating a database (using the Access 1.1 engine) and selecting a field to be a primary index and requiring a unique index value, what will happen when the program is running and the user tries to enter a duplicate record? Will the program crash, or will a message pop up telling the user that he is trying to enter a duplicate record?

Answer:
You will need to use an error trap with On Error Goto error_handler label to make this work. You can trap the error when it occurs. Try doing what you described and you can look at the Err property for the number, and Error$ for the text.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date