|
-
Mar 4th, 2002, 05:51 AM
#1
Thread Starter
Junior Member
error in storing list box values in table
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
-
Mar 4th, 2002, 06:04 AM
#2
Bouncy Member
why not just delete all exising records from the table, then add all in the list.
should be quicker and easier.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|