quick query with regards to populate problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • compwizard
    New Member
    • Feb 2008
    • 12

    quick query with regards to populate problem

    Hello All,

    I have a quick question, well im hoping it is quick

    i am trying to edit an item from a listbox, what i am trying to do is double click on an item from the listbox during placing a order, and i would like this item to appear within the orderline above to start to edit, Currently i could get this to happen. then i want to edit the quantity column and select edit, when this is pressed i would like to repopulate the listbox with the change made to the correct item.
    Currently when i click edit it is saving the changes but not to the correct item. for example if my first item was top and quantiy 10 and second item ordered is bottom quantity 2. if i change the second item it is updating the first item. what ive noticed is that it is changing the first item with the list table

    This is what i have been trying
    Code:
    Private Sub cmdcorrect_Click()
    
      Dim rstreset As Recordset
    
        If MsgBox("update order?", vbYesNo, "Confirmation") = vbYes Then
            
            Set rstreset = dbase.OpenRecordset("tblline")
                rstreset.Edit
                rstreset!QuantityNo = cboquantity.Value
                rstreset!total = txttotal.Value
                rstreset.Update
                Call populate
         
        End If
          
       
    End Sub
  • compwizard
    New Member
    • Feb 2008
    • 12

    #2
    Code:
    Set rstreset = dbase.OpenRecordset("SELECT * FROM tblline WHERE itemID = " & Me.Listbox)
    I have also tried this, but then it shows too few parameters expected1

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32634

      #3
      Consider a form representing an order. You can have a ComboBox in this form which identifies the related order lines. On selection of a line, you could get that item to open in a separate form (a subform would work fine too). Edit the item there if required. When done, remember to call a .Requery on the ComboBox control to allow it to reflect the new details.
      I'm afraid the way you're currently looking to do it is not a good idea and I, for one, don't even want to go there.

      Comment

      Working...