A problem with duplicate records

Posted on 2003-02-22
Medium Priority
Last Modified: 2010-05-01
I'm having some problems with an app I'm making.

It collects data from a text-file, but I'm dependent on having unique values. Unfortunatly the text-file I'm grabbing data from, has a few duplicate entries and this is causing a problem when using this code where tbl_data_unique is Primary Key:

dtagames.Recordset!tbl_data_unique= ldata(0)
dtagames.Recordset!tbl_data_name = ldata(1)

It's possible to remove the primary-key and remove duplicate records afterwards, but my preferred solution would be to have some error handling, skipping the recordset-creation if the fieldvalue already exists (As I'm getting an error message, it should be possible to trap this message and move on, shouldn't it?).
If this is not possible however, I would like to get some advice on removing duplicate entries in my table efficiently.

Thank you for your time...

EDIT: Sorry for posting this in the wrong section. Visual Basic -> VB DB would be more appropriate.

Question by:tyrron
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
LVL 18

Accepted Solution

Sethi earned 100 total points
ID: 8001584
In Error handler use The "Resume Next" statement and your problem will be solved.

Author Comment

ID: 8001785
That was easy :)


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, left to enroll

770 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