I want to store the listbox values in the database table. So that, i use the code given below. Actually, listbox contains the values like "DD,AA,BB,CC,EE,FF,DD,CC". Totally, there are 8 values in it. If i run the program first time, only 6 values are added. (ie), the repeated values like DD,CC are not added. I have to add those values also. At the same time, when i run the program second time, the eight values which are added first should not be again added to the table. How to do this using vbcode? Please help me.


for i=0 to list1.listcount-1
'Attempt to find the entry.
rs.findfirst "'fnam='" & list1.list(i) & "'"

'Check if the entry was already found
if rs.eof then
rs.addnew
rs![fnam]=list1.list(i)
rs.update
end if
next i