Wrox Programmer Forums
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 11th, 2006, 07:03 PM
Registered User
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Yes to duplicates

is there any way that i can add duplicates in a record?
by the way,my program contains a frmAdd where user adds in a task and its description, and this gets stored in the database. Looks like when i add a task with the same name but different descriptions, my program seems to read in both tasks as the same one, and completely ignores the other one!

Old July 12th, 2006, 01:29 PM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

Could you give more details?
What is the action that results in “completely ignores the other one”?
What is the manifestation of “completely ignores the other one”?
What DB system is this?
Old July 13th, 2006, 05:09 PM
Registered User
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

i am using MSAccess 2003 with VB6.
in my frmAdd(VB),i have txtTask,txtDocuments,DTPicker(to show due date),txtDays,txtAttach,txtNotes and command buttons,cmdSubmit,cmdBack. when i add new tasks, my program writes to the db which stores these added tasks and displays it in a report also in db.displaying in the report is fine!
meanwhile,say i add a task 'Appointment meeting' with all the necessary details in the appropriate txtboxes, i click submit, my task is stored in the db. then i add another task with the same name, but choose a different date from the DTPicker. now, my program should read that as a different task from the first one..but looks like, it completely ignores the first one added, and reads in the 2nd one as same as the 1st one.

in my db, i have a table 'AddRecord' where these added tasks are stored, it has the fields as from the frm, Task, Documents, DDate, Days, Notes, Attachment...i have id as an autofield number, should i assign this as my PK?

Old July 14th, 2006, 11:51 AM
Friend of Wrox
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts

Commonly the auto generated identity field (Autonumber field in Access) is used as the primary key for a table.

I am a little confused here: You state that your "program" should read records that have the same name as separate tasks, and that makes sense. But what doesn't make sense is that this is your program, and your code... it won't do anything on its own without you having written the instructions. SO it is not your program that is ignoring the first record, so to speak, but instead it is your instructions that retrieve or display the records that are incorrect.

So you need to look at whatever part of your code that retrieves and/or displays the records to see why it is only retrieving the most recent record of with a particular name. This could be in your sql select statement, or it could be in some code you have written that displays the records.

Woody Z http://www.learntoprogramnow.com

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing duplicates hewstone999 Access VBA 2 November 4th, 2008 05:26 PM
Checking for duplicates toedipper2 SQL Server 2000 3 June 7th, 2006 03:50 PM
Duplicates in XSLT d_sathish XSLT 1 November 9th, 2005 11:45 AM
Delete duplicates? boson SQL Language 2 August 11th, 2004 04:47 PM
Duplicates ashley_y Access 11 August 14th, 2003 03:41 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.