Solved

How do I operate an table in access using VB?

Posted on 1998-08-06
1
143 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

705 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