Solved

How do I operate an table in access using VB?

Posted on 1998-08-06
1
128 Views
Last Modified: 2010-08-05
I creat a table in Access using VB and can add only the first record in the table. However, it is rejected when adding the second record and the system recognize as an '3022' run time error.
0
Comment
Question by:wilkinswong
1 Comment
 

Accepted Solution

by:
Lord_2Kewl earned 20 total points
ID: 1468090
Hello,

Actually the run-time error 3022 means that the commit of the new record is refused because it violates a rule in your database. This can be a duplicate value for an index, a primary key or a relationship. Making sure that the values clashing with this rule, or rules, are distinct will solve your problem.
For a reference to the trappable errors look for the section
"Trappable Microsoft Jet and DAO Errors". As far as I know this
section is not directly accessable but it can be linked to by finding the "Number" property of the DAO "Err" object.

Good luck and Have Fun.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now