Results 1 to 2 of 2

Thread: ListBox Selection Problem (resolved)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    16

    ListBox Selection Problem (resolved)

    I have a listbox that has customer transactions. There is a button that reconciles the highlighted transaction. The code for the reconcile button is:

    Private Sub cmdRecon_Click()

    If MsgBox("Are you sure you wish to reconcile selected records", vbYesNo) = vbYes Then

    For i = 0 To List1.ListCount - 1

    If List1.Selected(i) Then
    Text1.Text = List1.Selected(i)

    DE1.Con1.Execute ("UPDATE Transactions SET Pending = 'Paid' WHERE PhoneNumber = '" & Left(List1.List(i), 10) & "' ")
    End If

    Next i

    End If
    List1.Clear
    Command1_Click

    End Sub

    The problem is that if you highlight a specific transaction, it reconciles all transactions with the corresponding phone number and not just the highlighted transaction. This is a problem because certain phone numbers have multiple transactions. Any help would be greatly appreciated.
    Last edited by TeamPIP; Jan 6th, 2003 at 02:16 PM.

  2. #2
    Addicted Member Sully's Avatar
    Join Date
    Nov 2002
    Location
    Lost in the far recesses of one's own mind.
    Posts
    165
    Obviously your SQL statement is updating all records with the corresponding phone number, is there anything else you can use to identify the record uniqely...
    Disclaimer:

    * The preceding message was in no means meant to be critical, mean spirited, insincere, or facetious.

    Disclaimer for disclaimer:

    The preceding disclaimer may in fact be facetious in nature.

    Thanks,
    Jim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width