-
Private Sub Form_Load()
-
ListView1.Refresh
-
ListView2.Refresh
-
ListView1.View = lvwReport
-
ListView2.View = lvwReport
-
ListView1.ColumnHeaders.Add , , "ID"
-
'ListView1.ColumnHeaders.Add , , "NAME"
-
ListView2.ColumnHeaders.Add , , "DATE"
-
ListView2.Refresh
-
rs.Open "select distinct id from saldetail", conn, adOpenStatic, adLockOptimistic
-
ListView1.Refresh
-
While Not rs.EOF
-
-
With ListView1
-
Set lvitem = ListView1.ListItems.Add(, , rs!id)
-
'rs1.Open "select * from empdetail where id = '" & ListView1.ListItemsItem & "'", conn, adOpenStatic, adLockOptimistic
-
'lvitem.SubItems(1) = rs1!Name
-
End With
-
rs.MoveNext
-
Wend
-
rs.Close
-
Set rs = Nothing
-
ListView1.Refresh
-
ListView2.Refresh
-
end sub
-
the above code is to retrieve id from a table saldetail,where i have to retrieve the corresponding names of the ids from another table,is it possible in alist view control???
where i have gone wrong???
please help
15 2205
Hi,
Open Recordset like this :
rs.Open "select distinct S.id , e.* from saldetail S, EmpMas E Where S.ID = E.ID ", conn, adOpenStatic, adLockOptimistic
REgards
Veena
Hi,
Open Recordset like this :
rs.Open "select distinct S.id , e.* from saldetail S, EmpMas E Where S.ID = E.ID ", conn, adOpenStatic, adLockOptimistic
REgards
Veena
But Veena,
I cant understand that,can u please explain it once more,
even im getting errors in EmpMass
Please explain it
Hi,
Open Recordset like this :
rs.Open "select distinct S.id , e.* from saldetail S, EmpMas E Where S.ID = E.ID ", conn, adOpenStatic, adLockOptimistic
REgards
Veena
rs1.Open "select empdetail.id,saldetail.name where empdetail.id = saldetail.id", conn, adOpenStatic, adLockOptimistic
'i have tried with this code too tat too error occurs
Hi,
try this :
rs1.Open "select empdetail.id,saldetail.name from empdetail , saldetail where empdetail.id = saldetail.id", conn, adOpenStatic, adLockOptimistic
Regards
Veena
Hi,
try this :
dim ivitem as Listitem
rs1.Open "select empdetail.id,saldetail.name from empdetail , saldetail where empdetail.id = saldetail.id", conn, adOpenStatic, adLockOptimistic
Regards
Veena
rs.Open "select distinct id from saldetail", conn, adOpenStatic, adLockOptimistic
rs1.Open "select empdetail.name,saldetail.id from empdetail,saldetail where saldetail.id = empdetail.id", conn, adOpenStatic, adLockOptimistic
ListView1.Refresh
While Not rs.EOF
While Not rs1.EOF
With ListView1
Set lvitem = ListView1.ListItems.Add(, , rs!id)
lvitem.SubItems(1) = rs1!Name
End With
rs.MoveNext
rs1.MoveNext
Wend
Wend
rs1.Close
Set rs1 = Nothing
rs.Close
Set rs = Nothing
ListView1.Refresh
ListView2.Refresh
this codeis to add two coulmns to a listview where both are from different tables.
But the line lvitem.subitems(1)=rs1!Nameis not working
Hi,
Before adding sub-items, you have to add Column Headers to the listview..
Regards
Veena
Hi,
Before adding sub-items, you have to add Column Headers to the listview..
its added at first
but error showing invariable optional
Nick
-
Private Sub Form_Load()
-
'ListView1.Refresh ' the list view is blank on start-up, does not need any refresh
-
'ListView2.Refresh ' donot refresh
-
ListView1.View = lvwReport
-
ListView2.View = lvwReport
-
ListView1.ColumnHeaders.Add , , "ID"
-
ListView1.ColumnHeaders.Add , , "NAME"
-
ListView2.ColumnHeaders.Add , , "DATE"
-
'ListView2.Refresh 'again
-
rs.Open "select distinct id from saldetail", conn, adOpenStatic, adLockOptimistic
-
'ListView1.Refresh 'and again
-
While Not rs.EOF
-
-
'With ListView1 'donot need "With",
-
Set lvitem = ListView1.ListItems.Add(, , rs!id)
-
'this code seem good, except ListView1.ListItemsItem ??? what does it mean
-
'rs1.Open "select * from empdetail where id = '" & ListView1.ListItemsItem & "'", conn, adOpenStatic, adLockOptimistic
-
'Try this
-
rs1.Open "select * from empdetail where id = '" & rs!id & "'", conn, adOpenStatic, adLockOptimistic
-
lvitem.SubItems(1) = rs1!Name
-
'End With
-
rs.MoveNext
-
Wend
-
rs.Close
-
Set rs = Nothing
-
'ListView1.Refresh
-
'ListView2.Refresh
-
end sub
-
the above code is to retrieve id from a table saldetail,where i have to retrieve the corresponding names of the ids from another table,is it possible in alist view control???
where i have gone wrong???
please help
Your actual code can do things you need, except it has lot of extra statement
Your actual code can do things you need, except it has lot of extra statement
but that doesnt work,now i have used the code -
-
ListView2.Refresh
-
rs1.Open "select empdetail.name,saldetail.id from empdetail,saldetail where saldetail.id = empdetail.id", conn, adOpenStatic, adLockOptimistic
-
While Not rs1.EOF
-
With ListView1
-
vitem.SubItems(1) = rs1!Name
-
End With
-
rs1.MoveNext
-
Wend
-
rs1.Close
-
Set rs1 = Nothing
-
that adds only one record,ie the last record,please help...........
but that doesnt work,now i have used the code -
-
ListView2.Refresh
-
rs1.Open "select empdetail.name,saldetail.id from empdetail,saldetail where saldetail.id = empdetail.id", conn, adOpenStatic, adLockOptimistic
-
While Not rs1.EOF
-
With ListView1
-
vitem.SubItems(1) = rs1!Name
-
End With
-
rs1.MoveNext
-
Wend
-
rs1.Close
-
Set rs1 = Nothing
-
that adds only one record,ie the last record,please help...........
No no, not that SQL state ment. See my reply above. you can copy that code and paste into your program. After that, you can delete all comment line. Try that code.
One more else, the saldetail table, as i think it has more than one field (ID), so, why do you SELECT only ID on salDetail
Hi,
Try this : -
Private Sub Form_Load()
-
ListView1.Refresh
-
ListView2.Refresh
-
ListView1.View = lvwReport
-
ListView2.View = lvwReport
-
ListView1.ColumnHeaders.Add , , "ID"
-
ListView1.ColumnHeaders.Add , , "NAME"
-
ListView2.ColumnHeaders.Add , , "DATE"
-
ListView2.Refresh
-
rs.Open "select empdetail.name,saldetail.id from empdetail,saldetail where saldetail.id = empdetail.id", conn, adOpenStatic, adLockOptimistic
-
If Not rs.EOF Then
-
rs.MoveFirst
-
Do While Not rs.EOF
-
With ListView1
-
Set lvitem = ListView1.ListItems.Add(, , rs!id)
-
lvitem.SubItems(1) = rs!Name
-
rs.MoveNext
-
Loop
-
End If
-
rs.Close
-
Set rs = Nothing
-
ListView1.Refresh
-
ListView2.Refresh
-
end sub
-
-
Regards
Veena
Hi,
Try this : -
Private Sub Form_Load()
-
ListView1.Refresh
-
ListView2.Refresh
-
ListView1.View = lvwReport
-
ListView2.View = lvwReport
-
ListView1.ColumnHeaders.Add , , "ID"
-
ListView1.ColumnHeaders.Add , , "NAME"
-
ListView2.ColumnHeaders.Add , , "DATE"
-
ListView2.Refresh
-
rs.Open "select empdetail.name,saldetail.id from empdetail,saldetail where saldetail.id = empdetail.id", conn, adOpenStatic, adLockOptimistic
-
If Not rs.EOF Then
-
rs.MoveFirst
-
Do While Not rs.EOF
-
With ListView1
-
Set lvitem = ListView1.ListItems.Add(, , rs!id)
-
lvitem.SubItems(1) = rs!Name
-
rs.MoveNext
-
Loop
-
End If
-
rs.Close
-
Set rs = Nothing
-
ListView1.Refresh
-
ListView2.Refresh
-
end sub
-
-
Regards
Veena
do loop has a pblm???
Hi,
Tried the Code...?
Copy the entire code and run..
What error you are getting...?
Regards
Veena
Hi,
Tried the Code...?
Copy the entire code and run..
What error you are getting...?
Regards
Veena
yes, Loop without do
i tried with while that too wend wthout while........
Nick
Hi,
Tried the Code...?
Copy the entire code and run..
What error you are getting...?
Regards
Veena
Yes ,
a slight pblm occured due to end withnow its working
THANKS VEENA.....................
Sign in to post your reply or Sign up for a free account.
Similar topics
by: tom |
last post by:
I am new to SQL administration.
>From a list of IDs that are the primary key in one table (i.e. Customer
Table), I want to make changes in tables that use those IDs as a
foreign key.
...
|
by: David Deacon |
last post by:
Hi i was given the following advise,below my OriginalQuestion
I am a little new to ADOX can you direct me to the following
Do i place the code behind a button on a form?
Or do i place it in the...
|
by: dwok |
last post by:
Does anyone know of a good article that discusses creating a "Tree
View" control in ASP.NET? Or perhaps a Tree View Control that comes
with source code? I have come across a lot of tree controls...
|
by: WStoreyII |
last post by:
I wish to make a custom view of relations in a datagrid
what i want to do is when the plus sign is clicked instead of showing the
link label
i want to show a grid with the subtable in that area...
|
by: Brian Henry |
last post by:
Here is another virtual mode example for the .NET 2.0 framework while
working with the list view. Since you can not access the items collection of
the list view you need to do sorting another...
|
by: Smokey Grindle |
last post by:
does anyone know of any good tree list view controls (for commercial usage)?
I need something that is high quality, and looks similar to the detail view
of the list view and in a tree format......
|
by: Rabbit |
last post by:
Cascading Combo/List Boxes
This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
|
by: Greg |
last post by:
I have a listbox control that displays it's data using the DataSource,
DisplayMember and ValueMember properties. I've worked a thrid party control
(DevExpress)
that a similar ListBox control that...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |