-
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 2217 QVeen72 1,445
Recognized Expert Top Contributor
Hi,
Open Recordset like this :
rs.Open "select distinct S.id , e.* from saldetail S, EmpMas E Where S.ID = E.ID ", conn, adOpenStatic, adLockOptimisti c
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, adLockOptimisti c
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, adLockOptimisti c
REgards
Veena
rs1.Open "select empdetail.id,sa ldetail.name where empdetail.id = saldetail.id", conn, adOpenStatic, adLockOptimisti c
'i have tried with this code too tat too error occurs
QVeen72 1,445
Recognized Expert Top Contributor
Hi,
try this :
rs1.Open "select empdetail.id,sa ldetail.name from empdetail , saldetail where empdetail.id = saldetail.id", conn, adOpenStatic, adLockOptimisti c
Regards
Veena
Hi,
try this :
dim ivitem as Listitem
rs1.Open "select empdetail.id,sa ldetail.name from empdetail , saldetail where empdetail.id = saldetail.id", conn, adOpenStatic, adLockOptimisti c
Regards
Veena
rs.Open "select distinct id from saldetail", conn, adOpenStatic, adLockOptimisti c
rs1.Open "select empdetail.name, saldetail.id from empdetail,salde tail where saldetail.id = empdetail.id", conn, adOpenStatic, adLockOptimisti c
ListView1.Refre sh
While Not rs.EOF
While Not rs1.EOF
With ListView1
Set lvitem = ListView1.ListI tems.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.Refre sh
ListView2.Refre sh
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
QVeen72 1,445
Recognized Expert Top Contributor
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...........
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.
Basically I want to say:
If fk_ID is in list then
do these statements to that record
|
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 On Open event and have a the default 10% and
give the user the option to change it to 0%
I have referenced th appropriate library and the default value of the
field to change is 0.1
|
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 for ASP.NET
however most of them are already compiled and don't come with source
code. I am really just looking for an example on how to create my own
Tree Control. Thanks a bunch.
|
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 between the selected
grid and the next grid.
however i cannot seem to find a method of obtaing the position coordinate
for that area.? and ideas on how to go about finding the position?
WStoreyII
|
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 way... here is my code on how I
did it to help anyone starting out get an idea of how to use virtual mode in
..NET 2.0
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
| |
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... willing to spend money for a
control.. thanks a lot!
|
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 determines the available options in the other.
TERMINOLOGY
Row Source: The table/query from which the Combo Box or List Box gets its values. Note: There are other types of row sources that can be used but for simplicity we will stick with Tables...
|
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 allows me to add columns. I typed in the
following
dim colHeader as ListBox.Col (And no column appears).
With DevExpress I am able to add columns definng my own columens, and back a
while ago, I know I was able to use the Microsoft List Box...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |