Change value of a column in a listbox. Help!

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a list box with several columns.
Once an item in the listbox is selected, I would like to be able to
change the value of column 4.

Some detail about what I am trying to do.
My listbox is ordered ascending using Column 4 wich
contains sequential numbers. So for example, if I have 8 rows,
column 4 will contain the numbers 1 thru 8
I am trying to create a procedure behind a button called "Move Up"
so that I can select a row (let's say row 5) and move it so it becomes
row 4, and then row 4 would obviously become row 5.
I created cloumn 4 with sequential numbers primarily for this.
Any ideas are welcome.
Thank you
 
Hi,
I think you have to remove selected item and then insert it again with
necessary values (.additem and .removeitem methods). or you can change data
in underlying table and then requery listbox. depends on how do you fill it

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
Your second suggestion to change the data in a particular column is exactly
what I am asking about.
I want to CHANGE the VALUE of Column 4 in a listbox that is filled by using
a query of underlying tables.
 
As Alex said, you need to update the appropriate record(s) in the
underlying table(s) and then use the ListBox's Requery method.

The updating can be done in any of the usual ways (e.g. by constructing
and executing a SQL UPDATE statement).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top