Deleting selects field

dedub

VBA DUMMY
Local time
Yesterday, 21:58
Joined
Oct 7, 2005
Messages
13
I have this code that works fine exept for one thing. If I have two names that are the same it deletes them both.
Code:
currentdb.execute "insert into charmer91 (last,first) values ('"me.list0 & "','" & me.list0.column(1) & "')"
currentdb.execute "delete table1 (last, first) from table1 where last ='"&list0 &"'"
How can I change the delete statement so it only deletes the selected name I have in list0, ie.. the highlighted one?
Basically Im moving data from one table to another via listboxes.

thanks in advance
 
dedub,

Code:
currentdb.execute "insert into charmer91 (last,first) " & _
                  "Values ('"me.list0 & "','" & me.list0.column(1) & "')"

currentdb.execute "delete table1 (last, first) " & _
                  "From table1 " & _
                  "Where last ='"&list0 &"' And First = '" & me.list0.column(1) & "')"

Wayne
 
Wayne, thanks so much, that did the trick!

take care

ds
 

Users who are viewing this thread

Back
Top Bottom