473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
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
2 1402
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
32,556 Expert Mod 16PB
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

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

Similar topics

8
by: Tom wilson | last post by:
This is driving me nuts. I'm trying to update an Excel spreadsheet using ADO.Net and Oledb in VB.Net. The connection is open, the adapter is connected and the dataset is loaded. Here's the code...
5
by: Tim Marsden | last post by:
Hello, I am building a parameterised query in vb.net for execution against a SQL server database. I am using a OLEDB command and OLEDB parameters. If one of the parameters is a date I sometimes...
2
by: roz | last post by:
Hello, I'm fairly new to VB programming and I've been going round the bend with this problem, so any nudges or shoves in the right direction would be greatly appreciated. I have a template...
1
by: Mayhem05 | last post by:
I have an Access 2003 database that I need to write some VBA code for to populate a table. The table is based on a query I have built in Access queries. Right now I have 2 parameters that are...
4
by: Jimmy | last post by:
I have a form with a command button on it that is supposed to open up a report and use a query to populate it. DoCmd.OpenReport "rptMailingList", acViewPreview, "qryMailingListChristmas" ...
3
by: olafbrungot | last post by:
I get the following error message when trying to connect to a host database (OBCD connection) with "MS Query". SQL0471N Invocation of routine "SYSIBM .SQLTABLES " failed due to reason...
2
by: DanWeaver | last post by:
I am assigning a profile variable based on the conents of a text box when a button is pressed- this is then used as a search term to populate a list box- all controls are in same ajax update panel-...
10
by: Trevor2007 | last post by:
I have a query that setting date from and date to from form values works: >=!! And <=!! but now I am trying to add another peramiter to pass in adition to above and now it doesn't work, I get...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.