By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

Checking for duplicate data in table

P: n/a
Hi All,

Hoping someone can help with this one.

I am opening a table and looping through the RecordSource (RcSr) of !

I am trying to add each email address to the string (strEmail) for use
in sending to outlook.

Within each loop i am looping through another instance of the same
record source (RcSr2)

This works fine EXCEPT if the record is duplicated then it does not
add it at all.

My brain is continually going around this loop so i am not a little

Any help would be greatly appreciated.


If RcSr.RecordCount <0 Then

Do While Not RcSr.EOF

Duplicate = 0
strTest = Nz(rsSrc!Email)

If RcSr2.RecordCount <0 Then
Do While Not RcSr2.EOF
strTest2 = Nz(rsSrc2!Email)
If strTest = strTest2 Then
Duplicate = Duplicate + 1
End If
End If
Set RcSr2= CurrentDb.OpenRecordset(sSQL2)
If Duplicate < 2 Then
If strEmail = "" Then
strEmail = RcSr!Email & ";"
strEmail = strEmail & RcSr!Email & ";"
End If
End If
End If

'''''End CODE

Aug 10 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.