RatherBeeHome said:
No, there is not a unique identifier in tbl_data. The ID field is
comma delimited that has multiple ID's from another table, i.e., ID
field has "4267, 8749, 2849", etc., which all of these ID's ARE the
primary key in the table that the form is based from.
Ugh. Then I believe you're going to need to use VBA code to work around
this faulty design. You might try this:
'----- start of code -----
' NOTE: Requires reference to the DAO object library.
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim CurrID As String
Dim CurrDescription As String
Dim CurrExample As String
Set db = CurrentDb
db.Execute "DELETE * from tbl_Data_temp;", dbFailOnError
stSelect = "SELECT Import.ID, Import.Description, Import.Example "
stInsert = "INSERT INTO tbl_Data_temp "
stFrom = "FROM Import "
stwhere = "Where Import.ID LIKE "
stwhere = stwhere & "'*"
stwhere = stwhere & Me!ID
stwhere = stwhere & "*';"
stSQL = stInsert & stSelect & stFrom & stwhere
db.Execute stSQL, dbFailOnError
Set rs = db.OpenRecordset( _
"SELECT * FROM tbl_Data_temp " & _
"ORDER BY ID, [Description], Example")
With rs
Do Until .EOF
If !ID = CurrID _
And !Description = CurrDescription _
And !Example = CurrExample _
Then
.Delete
Else
CurrID = !ID
CurrDescription = !Description
CurrExample = !Example
End If
.MoveNext
Loop
.Close
End With
Set rs = Nothing
Set db = Nothing
DoCmd.OpenForm "frm_data", acNormal
'----- end of code -----
That may work to remove duplicate records after the recordset is loaded.
I'm not 100% sure, though, because I'm not sure the SQL ORDER BY clause
is going to compare fields based on more than the first 255 characters.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)