Modules & VBA :: Finding Duplicates In A Table And Recording Values In That Record
May 2, 2014
I've been looking everywhere to find a better way of finding duplicates in a table and then recording and adding another value in that record together.
Let me try to explain better.
example:
I have a table that has 2 columns "Name", "DOB". I would like to find all duplicate "DOB" and add all of the "Name"'s together.
Quote:
Name DOB
bob 19800201
Sam 19761211
Jim 19800201
The output I would like is to have Name = bob & Jim DOB = 19800201.
I've tried using the find duplicate wizard in access but I can't seem to group them together and just to find the duplicates it takes upwards of a minute.
View Replies
ADVERTISEMENT
Jun 13, 2013
I am using Access 2010 32-bit on a Windows 7 64-bit platform.I have a database that I have imported existing data into. For the most part, I have eliminated duplicate entries in my Item Number field.
Obviously I have missed at least one (or possibly more) duplicates. When I try to create a NO DUPLICATES index, I am informed that there are duplicate entries.I am looking for a quick way to generate a list of values that are duplicated so I can address those and correct them.Item number field is a number field of type DOUBLE with 2 decimal places.
View 2 Replies
View Related
Oct 4, 2014
I have to deal with string arrays that store text. I need info on copying, comparing, appending arrays. Also on passing arrays as parameters to subs or functions. Where I can get to this info quickly without having to browse through many screens.
In addition to this I have some questions:
I have to find the duplicates of values in an array. Here is the code that I use.
Code:
Sub FindDuplicates()
Dim I As Integer, J As Integer, IEND As Integer, text() As String
ReDim text(IEND)
For I = 1 To IEND - 1
For J = I + 1 To IEND
If text(I) = text(J) Then text(J) = ""
Next J
Next I
End Sub
It works but is not performing well. Are there more efficient ways of doing this?
View 14 Replies
View Related
May 18, 2005
Hi All,
I have one table where ID field is autogenerated, and another field orderno which is not primary key. Now it has 2 duplicate values in it so when I try to make field Orderno as primary key, it is not allowing me to do so.
Can any one help me how to find the duplicate values using query.
Thanks in advance,
Jigs
View 1 Replies
View Related
Aug 3, 2006
I Have a problem in which when I create a record I wish the record to automatically record the time it was created. I have achieved this by having a timerecorded field within the table and setting its default value to time().
later on I wish another time to be recorded. This time when the user selected an option box to -1 I wish the time to be stamped into another field. I have used this event procedure to write the time to another field.
Private Sub AOGCleared_AfterUpdate()
'Update Time
If Me.AOGCleared = -1 Then
Me.TimeAOGCleared = Time()
Else
Me.TimeAOGCleared = ""
End If
End Sub
however It records the original time of creation when the obtion box is selected. Can anyone please point me in the direction of how I get access to record this later time please ?
View 5 Replies
View Related
Nov 1, 2006
Hi
Is there a way of finding duplicate field entries in a table and a query: e.g.
In the Sickness Query (which contains, say 10 fields), in the Section field, it says "Benefits", and in the Week Commening field, it says "15/10/06"
And then
In the Nil Return Table (which only contains the Section & Week commencing fields), they also say "Benefits" and "15/10/06"
If there is a way of finding them, how do I delete the entry that has been made in the Nil return table?
Thanks
Maria
View 4 Replies
View Related
Aug 29, 2006
Hi, been searching this forum for a couple of months now im working with access and up till now i have solved most of my problems:D
Ok the problem.
For the purpose of the question I have a training database:
running one table with user id and user name.
another for job id and job name.
Another for training table with an autonumber, user id, job id, and date
Id like to build a query which bought up the newest only for each user id and job id.
eg.
UI JI Date
2 5 01/05/05
2 5 01/05/06
3 5 01/05/05
3 6 01/05/05
4 6 01/05/06
to
UI JI Date
2 5 01/05/06
3 5 01/05/05
3 6 01/05/05
4 6 01/05/06
Iv tried using a few different ways of using duplicate queryies etc, but im just too newb to figure it out :(
Any suggestions or help would be appreciated.
Thanks
View 3 Replies
View Related
Jan 21, 2005
I have a Lost and Found Database that I enter information in usually every day.
Lots of items like gloves and glasses are entered into the item/s description field as
name of item then color or some other descriptive.
How do you make the combo box bring up all of the items that are related so that I can
pick from a tighter list? Right now when I click on the combobox for say, gloves, it will
bring up only one record of gloves and then I have to scroll through the entire
database to find the right record.
Table Properties
Lost and Found ITEM/S DESC Field:
Field Size - 50
Required - Yes
Allow Zero Length - No
Indexed - No
Unicode Compression - Yes
Form Combo Box After Update [Event Procedure]
Private Sub Combo22_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ITEM/S DESC:] = '" & Me![Combo22] & "'"
Me.Bookmark = rs.Bookmark
End Sub
View 4 Replies
View Related
May 16, 2005
Sorry for the question's wording.
Here is what bugs me:
- I have one table tblRefctc with the followings fields :
LCtcRef,../..,LRefServ0, LrefServ1,..LrefServ16.
Where all those Lref are long; LCtcRef being the primary key. This table describe a contact from different branches (account, etc..) so while each branch has the relevant information about this contact, they know that that branch too is in contact with the same person.
- I have this other table with describes Events, TblIdxEvt (meeting, whatever) :
LRefidx,IdxEvt,IdxCtc
where IdxCtc is filled with LCtcRef once an event is created.
What I must check for is : For the same IdxEvt, should another branch makes an appointement for LCtcRef (i), I must check if one of the LRefServ0 to LRefServ16 are not already added in the event table.
At this time, I am stuck with making functions which test the existence of the LRefServ(i) (i ranging from 0 to 16) in tblIdxEvt, but I wonder if there is a simpler way to do it with SQL (which, as you could guess, Im not good at).
Thanks in advance for any pointers.
View 2 Replies
View Related
Apr 2, 2014
I need to create a query that will pull duplicate names out of my db.
I would like it to pull all names that have:
duplicate LastName and duplicates of the first 3 letters of the FirstName.
For example, if I had the names:
Bland, Abe
Brown, Abe
Brown, Bill
Buster, Jon
Buster, Jonathon
I would like my query to return only Buster, Jon and Buster, Jonathon.
View 4 Replies
View Related
Apr 13, 2014
I'm trying to create a combo box that takes its values from a field in a table, the thing is that this field has duplicates because:
* The table is a qualification look up table
* It has 3 fields: QualificationID (autonumber), Qualification(e.g. Bachelor), Programme (e.g. Science)
* E.g of duplicate values (this is not a problem as it is necessary) Bachelor of Science, Diploma of Science, Certificate of Science
What I'm trying to do is create 2 single-columned combo boxes that are a parameter for a query and it's working except the combo boxes show duplicated valuesIs there a way to get the query that is the row source for the combo box to eliminate duplicates?
View 2 Replies
View Related
Feb 11, 2014
My question is which method of finding the last record is best, QueryDef or Recordset? Here is my data:
Table:
tbl_module_repairs
Field:
aps_rma
Textbox to insert last record RMA into:
txt_test
Here is some code I tried but get an invalid argument msgbox:
'''''''''''''''''''''''''''''''''
'Opens last RMA into textbox (For opening tag sheet)
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
'Get the database and Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tbl_module_repairs")
[Code] .....
View 14 Replies
View Related
Dec 13, 2007
Hello,
I am just starting Access...
Or at least trying to learn it on a small project, and I need a jumpstart, if someone woild be so kind and help me out.
I need to organize my e-mail sendings.
In one table (Table Sent) I have e-mail addresses where I have already sent messages.
In an other (Table New) I have some other e-mail addresses, I am preparing to send out.
To make sure to not send mail to those who already got one, I need to compare the two tables, and delete from the Table New those addresses which are already present in Table Sent.
I guess that would be a 2-3 line SQL script...
All of my attempts so far produced no results
Any guidance would be great!
Thanks
Attila
View 14 Replies
View Related
Jul 18, 2012
Product Name
Start Weight
End Weight
Product 1
379000
389000
Product 2
288435
226710
Product 3
699000
318882
Product 4
36800
50000
Product 5
89180
117280
Product 6
132000
132000
Product 7
18
18
Product 1
Product 2
Product 3
Product 4
Product 5
Product 6
Product 7
View 3 Replies
View Related
Mar 8, 2013
I've been working on trying to get this code to work as expected for days. I'm trying to find duplicates (I can't use primary keys or indexes alone to weed out duplicates due to the structure of the tables involved) in a subform as a user enters data. As soon as a project number is added, the code is supposed to count the number of records that contain that particular project number as well as a category number (there can be multiples of the same project numbers as long as their category numbers are different). This is the code I am using in the "Before Update" event of the field in the subform:
Private Sub ProjectID_BeforeUpdate(Cancel As Integer)
Dim strCriteria As String
Dim RecCount As Integer
strCriteria = "([ProjectID] = " & Me.ProjectID & ") AND ([CatID] = " & Me.CatID & ")"
RecCount = DCount("[ProjHrsID]", "tblProjHrs", strCriteria)
[Code] .....
What could I be doing wrong? Nothing about this code seems to work properly - even the Undo and Cancel=True is a problem (I get the "No current record" error).
View 2 Replies
View Related
Oct 20, 2014
If there a way i can remove duplicates from an email list? I pull these emails from a recordset. But i email may appear more than once and it doesn't look good e.g
johndoe@mail.com;johndoe@mail.com;jo...hndoe@mail.com.
I'd like to remove the duplicated email, if its possible. Code below.
Code:
Set rs = CurrentDb.OpenRecordset("select * from query")
With objMailItem
If rs.RecordCount > 0 Then
rs.MoveFirst
Do
If Not IsNull(rs![email]) Then
vRecipientList = vRecipientList & rs![email] & ";"
rs.MoveNext
Else
rs.MoveNext
End If
Loop Until rs.EOF
.To = vRecipientList
View 6 Replies
View Related
Jun 19, 2013
From what I have read, I understand you can't use the seek command on a recordset from a linked table from another database. Is that true? If so, what is the alternative to find a specific record in the table using an indexed field?
View 4 Replies
View Related
Jul 19, 2007
hi,
I linked a table (front to back) yesterday. I had a user enter information into this table. It's a login table. The login screen of the asp page is not able to find the record, even though I can see it in both tables. I am not sure what's wrong, since both tables show the same information. Does anybody have any ideas?
thanks in advance.
View 2 Replies
View Related
May 13, 2015
I am trying to loop through a table and count the duplicate records only once. Please see the attached file.
1) In the test table, I want to loop through all pt_accts.
2) In the countable column, if an acct repeats, I essentially just want to put "1" in one of the records. For the non-repeating accts, putting in a 1 is sufficient. Basically, I just don't want to count the duplicate ones multiple times.
In the example, acct "aaa" repeats, but there is just one "1" in the countable column. "eee" repeats as well, but there is just one "1" and the rest is 0.
Is this possible via VBA?
View 14 Replies
View Related
Jul 20, 2007
Hi,
I hope someone can help.
I have a macro that appends and deletes records to a new table once the the record has been closed. I need to record the date this was done in my original table and the new table and have had brain freeze as to how to achieve this.
Any suggestions??
View 2 Replies
View Related
Mar 12, 2015
I have two tables, tblCandidate and tblNewHire. I am trying to transfer candidates to tblNewHire based on the date they are hired. However, I would like the database to skip any records that are already in tblNewHire, just in case someone inadvertently puts in the wrong date when running the query.
I created an append query (SQL below) but this enters the data regardless of duplication. I need to be able to check both SSN and LastName against the new table and can't set either one to be unique values as it's possible there could be two candidates with the same last name.
Any way to do this by creating a recordset and looping through to check for dupes.
INSERT INTO tblNewHire ( SSN, FirstName, MiddleName, LastName, Phone, Email, EOD, HiringMechanism )
SELECT tblCandidate.SSN, tblCandidate.FirstName, tblCandidate.MiddleName, tblCandidate.LastName, tblCandidate.Phone, tblCandidate.Email, tblCandidateTracking.ActionDate, tblCandidateTracking.HireMechanism
FROM tblCandidate INNER JOIN tblCandidateTracking ON tblCandidate.SSN = tblCandidateTracking.SSN
WHERE (((tblCandidateTracking.ActionDate)=[forms]![frmNewHireMain]![txtEODDate]) AND ((tblCandidateTracking.LastAction)="EOD"));
View 2 Replies
View Related
May 6, 2015
I have code written which imports excel data to a access table but after the first import it fails due to duplicates, how can i tell it to ignore duplicates in the table and only copy new records?
code is below.
Code:
Function SyncEmployes()
Dim lngColumn As Long
Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
[Code].....
View 6 Replies
View Related
Feb 12, 2008
Hi this is my first post... so hi all :)
ok what i have is a table with contact details 900k plus
there are about 90k of which are duplicates.
this is the basic feilds that are important in this case.
Id, data_source, data_recived, data_code,
what i want is to have a table with unique records (no dups in data_code)
this table will look like this...
Id, data_code, Num_dups, dup1_source, dup1_date, daysbtw_Dup1_dup2, dup2_source, dup2_date, daysbtw_Dup2_dup3 ,dup3_source, dup3_date, daysbtw_Dup3_dup4 ,dup4_source, dup4_date,
I know there is no more than 4 dups of each record.
what i want from this is a table that will give me a record of how many dups for each record then all the dates that they were added and the date between each record entry.
if anyone can help it would be great .
thanks in advance.
View 6 Replies
View Related
Jul 5, 2006
Hi All,
This is my first post on this forum...:)
I'm having the following problems:
I have a table with "n" fields.
Each field will constitute a form.
Each form will have a button which will open the next form.
Basically I want to record new data into the table (database) through FORMS.
What I am unable to do is to record data on the same line in the table !!!
What I have so far is that I am able to move to the next record when creating a new NCR but the rest of the data (fields) are going to overwright the first record in the table (first line).
I would attach my database here but the file size is bigger that permitted.
If someone interested I could foward it on e-mail.
My second issue is that after recording data into the table I want to be able to modify that data through a form. When a certain NCR number is choosed this will pop-up the NCR form with all fields from the table.
Any suggestions are more than welcomed.
Thanks for your help...
Mumus.
View 2 Replies
View Related
Jul 5, 2006
Hi All,
This is my first post on this forum...:)
I'm having the following problems:
I have a table with "n" fields.
Each field will constitute a form.
Each form will have a button which will open the next form.
Basically I want to record new data into the table (database) through FORMS.
What I am unable to do is to record data on the same line in the table !!!
What I have so far is that I am able to move to the next record when creating a new NCR but the rest of the data (fields) are going to overwright the first record in the table (first line).
I would attach my database here but the file size is bigger that permitted.
If someone interested I could foward it on e-mail.
My second issue is that after recording data into the table I want to be able to modify that data through a form. When a certain NCR number is choosed this will pop-up the NCR form with all fields from the table.
Any suggestions are more than welcomed.
Thanks for your help...
Mumus.
View 1 Replies
View Related
Nov 19, 2013
I shouldn't normally record calculated figures into my table. I'm willing to buck proper procedure here for ease of use for referencing in reports; also, it's just one data point that will be calculated only once and not changed.Anyhow, I have an IIF statement that calculates a total price based on a table of costs. I set this as the default value and it calculated properly - but once I set my text box to have a control source, it no longer calculates my cost.
I was hoping to set it so it calculated the cost and then write that total cost to my table.should mention that my calculated control is in a subform.
View 2 Replies
View Related