By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,575 Members | 1,395 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,575 IT Pros & Developers. It's quick & easy.

quick query with regards to populate problem

P: 12
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
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdcorrect_Click()
  2.  
  3.   Dim rstreset As Recordset
  4.  
  5.     If MsgBox("update order?", vbYesNo, "Confirmation") = vbYes Then
  6.  
  7.         Set rstreset = dbase.OpenRecordset("tblline")
  8.             rstreset.Edit
  9.             rstreset!QuantityNo = cboquantity.Value
  10.             rstreset!total = txttotal.Value
  11.             rstreset.Update
  12.             Call populate
  13.  
  14.     End If
  15.  
  16.  
  17. End Sub
Feb 18 '08 #1
Share this Question
Share on Google+
2 Replies


P: 12
Expand|Select|Wrap|Line Numbers
  1. Set rstreset = dbase.OpenRecordset("SELECT * FROM tblline WHERE itemID = " & Me.Listbox)
I have also tried this, but then it shows too few parameters expected1
Feb 19 '08 #2

NeoPa
Expert Mod 15k+
P: 31,769
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.
Feb 20 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.