Error Runtime 3021 Delete 2 records different tables

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This one has got me stumped. I cant figure out this error for the life
of me. it goes through a listbox to see what index is indeed
selected... if selected then find that name in two seperate tables and
delete them. after that, reintailize the listbox to display updated
data. Any suggestions would help. thankyou.

For i = 0 To lstNames.ListCount - 1
If lstNames.Selected(i) = True Then
If chkBM.Value = True Then
cred = "[login_name] = '" & lstNames.ItemData(i) & "'"
status.FindFirst cred
user.FindFirst cred
If MsgBox("Are you sure you want to delete user: " &
status!login_name, _
vbYesNo, "Question") = vbYes Then
status.Delete 'ERROR LOCATION****************
user.Delete
lstNames.RowSource = "SELECT login_name FROM
tblLoginPWD ORDER _ BY login_name asc;"
txtNameCount = lstNames.ListCount
Else
MsgBox "User: " & user!login_name & " was NOT
deleted.", vbInformation, _ "Information"
Exit Sub
End If
End If
End If
Next

.



Relevant Pages

  • Re: List Boxes
    ... im getting an error (cant assign to read only ... Dim x As Integer ... ListCount is a read-only property. ... number of items in the ListBox. ...
    (microsoft.public.vb.general.discussion)
  • Re: List Item to uppercase
    ... >>I cant seem to get an Item in a ListBox and convert it to uppercase. ... >>sure this is simple, but I'm missing something. ...
    (alt.comp.lang.borland-delphi)
  • Re: Get list of running SQL servers in a LAN?
    ... I mean that i can see servers in lb1 (listbox) when i run app in W2K, ... cant see any item when i run it in WXP Pro. ...
    (borland.public.delphi.database.ado)
  • Listbox Sorting
    ... i cant seem to get my listbox not to sort the ... i haven't got any sorting in the query that fills the listbox ...
    (microsoft.public.access.formscoding)
  • Err Msg Prob
    ... The rowsource for the Listbox is a query of the tblTest described below. ... Exit Sub ...
    (microsoft.public.access.formscoding)