473,466 Members | 1,336 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

my listview is empty

143 New Member
Hello all,
i have listview called lvbill and a grid called grid_data1.. i m getting the data in my gird by nothing is appearing in my listview.. by pressing in the button cmdshowbill the listview and gird are appearing but my listview is empty..
is anybody there to help me out.. thank u very much
here is my code :

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdshowbill_Click()
  2.     LvBill.Visible = True
  3.     LvBill.ListItems.Clear
  4.     LvBillPo.Visible = False
  5.     Call BillList
  6.     cmdaddbill.Visible = True
  7.     MSHFlexGrid3.Visible = True
  8.      Call Grid_Data1
  9. End Sub
  10.  
  11.  
  12. Public Sub BillList()
  13. Dim i As Integer
  14. Dim TotalPay As Double
  15. Dim bal As Long
  16. Dim AdjAmt As Double
  17. Dim TdsAmt As Double
  18. Dim NewItem     As MSComctlLib.ListItem
  19. Dim NewColumn As MSComctlLib.ColumnHeader
  20. Dim Rs2         As New ADODB.Recordset
  21. Dim Rs1         As New ADODB.Recordset
  22. Dim SQL As String
  23.  
  24.  
  25.             LvBill.ListItems.Clear
  26.             LvBill.ColumnHeaders.Add 1, , "BillNo", 1500
  27.             LvBill.ColumnHeaders.Add 2, , "BillDate", 1500
  28.             LvBill.ColumnHeaders.Add 3, , "AmendNo", 1500
  29.             LvBill.ColumnHeaders.Add 4, , "billTotal", 1500
  30.             LvBill.ColumnHeaders.Add 5, , "AdjAmount", 2000
  31.             LvBill.ColumnHeaders.Add 6, , "TDSAmount", 2000
  32.             LvBill.ColumnHeaders.Add 7, , "BalanceAmt", 2000
  33.  
  34.  
  35.                  LvBill.Visible = True
  36.                  LvBill.ListItems.Clear
  37.                 ' Start
  38.                     If Rs2.State = adStateOpen Then Rs2.Close
  39.  
  40.  
  41.                      Rs2.Open ("SELECT * from Txbills where Unitid ='" & txtUnitId.Text & "' and VendorId ='" & txtVendorId.Text & "'And Ind <>'8'And Ind ='1'and YY = " & FinancialYear & " "), Db, adOpenKeyset, adLockPessimistic
  42.  
  43.  
  44.                     If Not Rs2.EOF And Not Rs2.BOF Then
  45.                     While Not Rs2.EOF
  46.                         Set NewItem = LvBill.ListItems.Add(, , Rs2.Fields("BillNo"))
  47.                             NewItem.SubItems(1) = Rs2.Fields("BillDate").Value
  48.                             NewItem.SubItems(2) = Rs2.Fields("AmendNo").Value
  49.                             NewItem.SubItems(3) = Rs2.Fields("BillAmt").Value + Rs2.Fields("BillTax").Value
  50.                             'NewItem.SubItems(3) = Rs1.Fields("PoTotal").Value
  51.                         'paid Amount
  52.                                     If Rs1.State = adStateOpen Then Rs1.Close
  53.                                     Rs1.Open ("SELECT Sum(AdjAmt),Sum(TDSAmt)  from txBills where BillNo ='" & Rs1.Fields("BillNo") & "' and BillYY = '" & txtyear.Text & " ' "), Db, adOpenKeyset, adLockPessimistic
  54.                                     If Not Rs1.EOF And Not Rs1.BOF Then
  55. '                                    While Not Rs.EOF
  56.                                             If IsNull(Rs1.Fields(0)) = False Then
  57.                                                  AdjAmt = Rs1.Fields(0).Value
  58.                                              Else
  59.                                                 AdjAmt = "0"
  60.                                             End If
  61.                                             If IsNull(Rs1.Fields(1)) = False Then
  62.                                                  TdsAmt = Rs1.Fields(1).Value
  63.                                              Else
  64.                                                 TdsAmt = "0"
  65.                                             End If
  66.                                             TotalPay = AdjAmt + TdsAmt
  67.                                             'bal = (Rs1.Fields("PoTotal").Value) - TotalPay
  68.                                             bal = (Rs2.Fields("BillAmt").Value + Rs2.Fields("BillTax").Value) - TotalPay
  69.                                             NewItem.SubItems(6) = bal
  70.                                         Rs1.MoveNext
  71. '                                    Wend
  72.                                 End If
  73. '                                Rs.Close
  74.  
  75.                         ' End
  76.  
  77.                         Rs2.MoveNext
  78.                     Wend
  79.                 End If
  80. End Sub
  81.  
Dec 5 '08 #1
4 2318
Dököll
2,364 Recognized Expert Top Contributor
Hey there good buddy!

Sorry for your troubles...

Can you step into it through debug mode to see if any fields are being returned?

Dököll
Dec 6 '08 #2
squrel
143 New Member
hi.. thank u for the reply
i had gone through the debug bt not getting any error or anything.. just nothing shows on my LVBILL... is my connection has some problem or have to set something? plz help
thank u
Dec 6 '08 #3
lotus18
866 Contributor
Try to check your query if it is returning a value or not.


Rey Sean
Dec 6 '08 #4
squrel
143 New Member
got the problem :)
thankx a lot to all
Dec 8 '08 #5

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

Similar topics

3
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the...
5
by: sethuganesh | last post by:
hi, i have created a sample window aplication in VB.NET.placed a listview component in the form ,written click and double click event for list view.But the events are not fired.is there any...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
0
by: Tark Siala | last post by:
Hi I have ListView include customers (foe example), and connected to "ContextMenuStrip" include (Edit Customer, Delete Customer, ...), when user right click on any Customer Item in ListView...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
7
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR ...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, In my application I need to periodically remove all current items from a ListView and add a new set into it. The following abbreviated code contains the basic idea: private void...
0
by: mesut | last post by:
Hi colleagues, I've a very strange problem here. I have no clue whyt it happens. I have a listview. The Listview populates well. I have an Update Button in the listview and a...
0
by: lsharva | last post by:
Actually, i m working on Windows Application where i have to use the ComboBox and listview in a way , as first we will click the comboBox and then as you click , ListView appear and when we...
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
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...
0
Oralloy
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,...
1
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.