Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95
      Become a Supporter    ::   Make a Contribution    Let's do it!

Re: Combining Field Data

Discussion in 'Information Technology' started by Stacy, Oct 29, 2005.

  1. Stacy

    Stacy
    Expand Collapse
    Guest

    Ok, so I have most of my code sketched out, but I am still having
    issues....
    My Code (below) adds the records to my new table fine, however, only
    the first name on my new table is looked at for potential duplicates,
    and I need it to scan the whole table for duplicate names, not just the
    first one. Any ideas?

    Plus, how do I get around the initial new table being empty. I keep
    getting a "no current record" error.

    Any help is appreciated.
    I am not great with VB code, just a novice trying to get my code to
    create miracles.
    Have a good day.
    Stacy


    Dim Str As String
    Dim rst As DAO.Recordset
    Dim rst2 As DAO.Recordset
    Dim db As DAO.Database
    Set db = CurrentDb
    Set rst = db.OpenRecordset("SELECT * FROM tblMasterPeople order by
    full_name")
    Set rst2 = db.OpenRecordset("SELECT * FROM tblFinCENCustomers order by
    full_name")
    rst.MoveFirst

    Do Until rst.EOF
    If rst!full_name = rst2!full_name Then
    With rst2
    .Edit
    !newdob = !dob & " ; " & rst!dob
    .Update
    End With
    rst.MoveNext
    Else
    With rst2
    .AddNew
    !tracking_number = rst!tracking_number
    !Entity = rst!Entity
    !last_name = rst!last_name
    !first_name = rst!first_name
    !middle_name = rst!middle_name
    !suffix = rst!suffix
    !full_name = rst!full_name
    !dob = rst!dob
    .Update
    End With
    rst.MoveNext
    End If
    Loop

    rst.Close
    rst2.Close
    MsgBox "Complete"
     
  2. Loading...


Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page