How To Stop Duplication? [Newbie-ish]
Ok the following code accesses a microsoft access 97 table.
It gets all the items from the "Sport" field..and puts them into a list.
The problem here is than i get duplicate entries.
in the list
Like Athletics
Athletics
Soccer
Athletics
one for each item.
Is there a modification to th following code ican make to ignore duplicates.
Code:
Dim DB As Database
Dim RS As Recordset
'Use the OpenDatabase function to open our database
Set DB = OpenDatabase("E:\Assignment3\Games.mdb")
Set RS = DB.OpenRecordset("EventTable", dbOpenSnapshot)
'Just in case
frmSportList.cboSportList.Clear
RS.MoveFirst
If RS.EOF = False Then
Do
frmSportList.cboSportList.AddItem RS.Fields("Sport").Value
RS.MoveNext
Loop While Not RS.EOF
RS.Close
Set RS = Nothing
Else
RS.Close
Set RS = Nothing
End If
DB.Close
Set DB = Nothing
Any help would be appreciated.
Sample sQl statements and so on.