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 : -
Private Sub cmdshowbill_Click()
-
LvBill.Visible = True
-
LvBill.ListItems.Clear
-
LvBillPo.Visible = False
-
Call BillList
-
cmdaddbill.Visible = True
-
MSHFlexGrid3.Visible = True
-
Call Grid_Data1
-
End Sub
-
-
-
Public Sub BillList()
-
Dim i As Integer
-
Dim TotalPay As Double
-
Dim bal As Long
-
Dim AdjAmt As Double
-
Dim TdsAmt As Double
-
Dim NewItem As MSComctlLib.ListItem
-
Dim NewColumn As MSComctlLib.ColumnHeader
-
Dim Rs2 As New ADODB.Recordset
-
Dim Rs1 As New ADODB.Recordset
-
Dim SQL As String
-
-
-
LvBill.ListItems.Clear
-
LvBill.ColumnHeaders.Add 1, , "BillNo", 1500
-
LvBill.ColumnHeaders.Add 2, , "BillDate", 1500
-
LvBill.ColumnHeaders.Add 3, , "AmendNo", 1500
-
LvBill.ColumnHeaders.Add 4, , "billTotal", 1500
-
LvBill.ColumnHeaders.Add 5, , "AdjAmount", 2000
-
LvBill.ColumnHeaders.Add 6, , "TDSAmount", 2000
-
LvBill.ColumnHeaders.Add 7, , "BalanceAmt", 2000
-
-
-
LvBill.Visible = True
-
LvBill.ListItems.Clear
-
' Start
-
If Rs2.State = adStateOpen Then Rs2.Close
-
-
-
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
-
-
-
If Not Rs2.EOF And Not Rs2.BOF Then
-
While Not Rs2.EOF
-
Set NewItem = LvBill.ListItems.Add(, , Rs2.Fields("BillNo"))
-
NewItem.SubItems(1) = Rs2.Fields("BillDate").Value
-
NewItem.SubItems(2) = Rs2.Fields("AmendNo").Value
-
NewItem.SubItems(3) = Rs2.Fields("BillAmt").Value + Rs2.Fields("BillTax").Value
-
'NewItem.SubItems(3) = Rs1.Fields("PoTotal").Value
-
'paid Amount
-
If Rs1.State = adStateOpen Then Rs1.Close
-
Rs1.Open ("SELECT Sum(AdjAmt),Sum(TDSAmt) from txBills where BillNo ='" & Rs1.Fields("BillNo") & "' and BillYY = '" & txtyear.Text & " ' "), Db, adOpenKeyset, adLockPessimistic
-
If Not Rs1.EOF And Not Rs1.BOF Then
-
' While Not Rs.EOF
-
If IsNull(Rs1.Fields(0)) = False Then
-
AdjAmt = Rs1.Fields(0).Value
-
Else
-
AdjAmt = "0"
-
End If
-
If IsNull(Rs1.Fields(1)) = False Then
-
TdsAmt = Rs1.Fields(1).Value
-
Else
-
TdsAmt = "0"
-
End If
-
TotalPay = AdjAmt + TdsAmt
-
'bal = (Rs1.Fields("PoTotal").Value) - TotalPay
-
bal = (Rs2.Fields("BillAmt").Value + Rs2.Fields("BillTax").Value) - TotalPay
-
NewItem.SubItems(6) = bal
-
Rs1.MoveNext
-
' Wend
-
End If
-
' Rs.Close
-
-
' End
-
-
Rs2.MoveNext
-
Wend
-
End If
-
End Sub
-
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
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
Try to check your query if it is returning a value or not.
Rey Sean
got the problem :)
thankx a lot to all
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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
...
|
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...
|
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...
|
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...
|
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,...
|
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: 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...
|
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,...
|
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...
|
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 ...
| |