473,320 Members | 2,162 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,320 software developers and data experts.

Moving data from one listbox to another

Hi,

So i have 2 listboxes, lstSource and lstDestination, lstSource takes it data from Resource table.

What i need to do is move list items one by one from lstSource to lstDestination and vice versa.

What i am doing right now is this,

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdMoveToList2_Click()
  2.    On Error GoTo Err_cmdMoveToList1_Click
  3.  
  4. If Me.lstSource.ListIndex >= 0 Then
  5.  
  6.     Me.lstDestination.AddItem Me.lstSource.ItemData(Me.lstSource.ListIndex)
  7.     End If
  8.  
  9. Exit_cmdMoveToList1_Click:
  10.     Exit Sub
  11.  
  12. Err_cmdMoveToList1_Click:
  13.     MsgBox Err.Description
  14.     Resume Exit_cmdMoveToList1_Click
  15.  
  16.  
And the same for lstDestination to lstSource.

The problem i am facing is that when i click on the icon to move from lstSource to lstDestination it adds not the ResourceName(which is the list value) but the corresponding Resource ID (which is the primary key of Resource Table).


And also since the row source type for lstSource is table/query, lstDestination to lstSource moving is not happening.

Pls advise.

Thanks,
Arya
May 2 '13 #1
2 4691
ADezii
8,834 Expert 8TB
The Method you are using is more than likely picting up the Value of the Bound Column, try:
Expand|Select|Wrap|Line Numbers
  1. Me.lstDestination.AddItem Me.lstSource.Column(1)
May 2 '13 #2
Firstly thank you very much.

While I am trying this code only single columns is moving to second listbox. for ex listbox one value is empno, empname,empcountry. while I try this code only empno is visible in listbox2
Sep 4 '15 #3

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

Similar topics

3
by: Baby Blue | last post by:
I have 2 codes below to grap data from another site. I use them to get the data from one News site. However, when I click on some link inside (such as :...
19
by: Caesar | last post by:
Hi, I'm wondering if anyone here can point me in the right direction. My host does not provide php, and so I need to pull this data from another server that does support such scripting. Help?...
2
by: luu duong | last post by:
I know this is probably easy but here is the details. I have an asp page that is not inside a frameset. I want to post data to another asp page that is inside a frameset. So firstpage.asp has...
6
by: davidmdalle | last post by:
Hello, I have been having a bit of trouble finding help on the safest way to move data files to a different disk on the same server. Most help is about moving data files to a different sqlserver. ...
5
by: Vanessa | last post by:
I have a question, is that any other way to retrieve data from another webpage besides using XML object? Because I am using XML object now but give me so much problems. If I used...
4
by: Andrea De Santi | last post by:
How can I redirect to another page with form data? In asp Classic I write: <form ... action="filename">...</form> and in then target page I write <%=request.form("fieldname")%> ..... but in...
3
by: Iavor Raytchev | last post by:
Hello, We a situation with a central database that contains the data that needs to be presented at N off-line terminals (N can be 5 000 can be 15 000). Each terminal presents unique data. The...
4
by: Peter Afonin | last post by:
Hello, I have a form with several buttons, and I need to post this data to several different applications. In ASP.NET 1.1 it was quite easy - I just used HTML controls (text or hidden), then...
1
by: jonathan184 | last post by:
After moving website to another server flash will not autoplay. The site has alot of flash stuff on other pages and all the flash works fine except for one page. The flash steps through when...
2
by: thread | last post by:
Hi All i'm building a database in access and i want to restrict permissions. from the access i can just limit the posiblity to unhide an hidden table and in this way i can preventing the users...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.