473,387 Members | 1,583 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,387 software developers and data experts.

Is it able to transfer the values from one lsit view to another???

103 100+
HI,
1) I have a list view with column id.and another list view with column name
can i get the name on other listview,if i click the id on the listview???
and
2)
if one value say gross salary of particular employee is not saved in databse and the calculation is in another form,if i have to get the gross salary of the particular employee by clicking the id in listv view1,(above mentioned),can i get that,IF THESE CONTROLS IN ANOTHER FORN WHER NO CALCULATION IS NOT DONE???

please clarify???
THANKS IN ADVANCE...........
Jan 7 '08 #1
12 2024
QVeen72
1,445 Expert 1GB
Hi,

It is definately possible if ListViews have same "Key" ..

Regards
Veena
Jan 7 '08 #2
Vbbeginner07
103 100+
Hi,

It is definately possible if ListViews have same "Key" ..

Regards
Veena
code:(vb)
If ListView1.SelectedItem.Checked = True Then
rs.Open "Select all date From saldetail Where id= '" & ListView1.SelectedItem & "'", conn, adOpenStatic, adLockOptimistic
ListView2.ListItems.Clear
ListView2.Refresh
ListView2.ListItems.Add = rs!Date
ListView2.Refresh
rs.Close
Set rs = Nothing

one listview with id and other with dates...
Check this out....
i need for one id i need to get their working dates as....say
102 01/02/08
01/04/08
01/06/08
but the above code is not working????pleaSE CHECK THRU
Jan 7 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

By looking into the Code, you are using ListView as some ListBox (Only one Column) , Its better you have 2 columns..
For Second ListView, You have to Add SubItems of ID, This can be used as Key. In first ListView also use the Same ID as Key..
So when you populate second list, It should Contain 2 Columns, ID and Date.
So when you search, you can loop throug for the matching IS's
What Code, are you using for populating the First ListView..?


Regards
Veena
Jan 7 '08 #4
debasisdas
8,127 Expert 4TB
1.Populate the first list view by selecting from database.
2.on selection of the id in the 1st control. pass the id to SQL and retrive the related records.
3.polulate the 2nd listview from the resultset.
Jan 7 '08 #5
Vbbeginner07
103 100+
Hi,
By looking into the Code, you are using ListView as some ListBox (Only one Column) , Its better you have 2 columns..
For Second ListView, You have to Add SubItems of ID, This can be used as Key. In first ListView also use the Same ID as Key..
So when you populate second list, It should Contain 2 Columns, ID and Date.
So when you search, you can loop throug for the matching IS's
What Code, are you using for populating the First ListView..?
Regards
Veena
SELECT THE RECORDS CORRESPONDING TO THE ID,WE HAVE SELECTED????
Jan 7 '08 #6
Vbbeginner07
103 100+
1.Populate the first list view by selecting from database.
2.on selection of the id in the 1st control. pass the id to SQL and retrive the related records.
3.polulate the 2nd listview from the resultset.
rite now im getting only one date corresponding to it..
Jan 7 '08 #7
debasisdas
8,127 Expert 4TB
rite now im getting only one date corresponding to it..
do you have multiple values in the table for the specified id ?
Jan 7 '08 #8
QVeen72
1,445 Expert 1GB
Hi,

Loop through the Recordset and add values to ListView2,
Check your code, you are adding only first Record..

Regards
Veena
Jan 7 '08 #9
Vbbeginner07
103 100+
do you have multiple values in the table for the specified id ?
same id repeated??? yes
Jan 7 '08 #10
debasisdas
8,127 Expert 4TB
Please find a related discussion here.
Jan 7 '08 #11
Vbbeginner07
103 100+
Hi,
Loop through the Recordset and add values to ListView2,
Check your code, you are adding only first Record..
Regards
Veena
If ListView1.SelectedItem.Checked = True Then
rs.Open "Select all date From saldetail Where id= '" & ListView1.SelectedItem & "'", conn, adOpenStatic, adLockOptimistic
ListView2.ListItems.Clear
ListView2.Refresh
ListView2.ListItems.Add = rs!Date
'ListView2.Refresh
'rs.MoveNext
ListView2.Refresh
rs.Close
Set rs = Nothing

my code is valid or not?
Jan 9 '08 #12
QVeen72
1,445 Expert 1GB
Hi,

Change it this way..

Expand|Select|Wrap|Line Numbers
  1. If ListView1.SelectedItem.Checked = True Then
  2.     rs.Open "Select all date From saldetail Where id=  '" & ListView1.SelectedItem & "'", conn, adOpenStatic, adLockOptimistic
  3.     ListView2.ListItems.Clear
  4. If Not RS.EOF Then
  5.     Do While Not rs.EOF
  6.         ListView2.ListItems.Add = rs!Date
  7.         RS.MoveNext
  8.     Loop
  9. End If
  10. rs.Close
  11. Set rs = Nothing
  12.  
Regards
Veena
Jan 9 '08 #13

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

Similar topics

11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
5
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for...
3
by: yma | last post by:
Hi, I put a .aspx page inside Server.Transfer() within a button. The page was created for testing so it only has button and I did not add code. When I click the button, it gave me an error...
2
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.