| | |
listview loading problem... plss help (using function)
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
hi guyzz... i have more than 1000 datas in my tables i loaded it in the listview using function..
but i have problem in loading it.. it consume almost 9 second to load all in the listview...
i think it is in my coding.. i would like to minimize it. here my code.
i tried already the byref and byval...
any suggestion wil be appreciated.
thx in advance
but i have problem in loading it.. it consume almost 9 second to load all in the listview...
i think it is in my coding.. i would like to minimize it. here my code.
Private Sub userPriceList1()
Set rsFltUser = Nothing
Set rsFltUser = OpenRS("Select branchcode,branchname,item_Number,item_name,balance_unitcost,balance_unit from itemlist order by item_name")
With rsFltUser
If .RecordCount <> 0 Then
.MoveFirst
Do While Not .EOF
Set lstitems = frmPOS.ListView2.ListItems.Add(1, , !branchcode & " - " & !branchname)
lstitems.SubItems(1) = IIf(IsNull(!item_Number), "", (!item_Number))
lstitems.SubItems(2) = IIf(IsNull(!item_name), 0, !item_name)
lstitems.SubItems(3) = FipoMethod(lstitems.SubItems(1), IIf(IsNull(!balance_unitcost), 0, !balance_unitcost))
.MoveNext
Loop
End If
End With
End SubPrivate Function FipoMethod(itmNO As String, Optional SCost As Currency) As Currency
Dim rs2 As ADODB.Recordset
Set rs2 = Nothing
Set rs2 = OpenRS("select item_number,srp_value,srp_setup from itemlist where item_number = '" & itmNO & "'")
With rs2
If .RecordCount <> 0 Then
If IsNull(!srp_value) = True Then !srp_value = 0
Select Case !srp_setup
Case 0
FipoMethod = Format(IIf(IsNull(!srp_value), 0, !srp_value), "standard")
Case 1
FipoMethod = Format(SCost + (CCur(SCost) * ("." & Val(!srp_value))), "standard")
Case 2
FipoMethod = Format(CCur(SCost) + CCur(!srp_value), "standard")
End Select
End If
End With
Set rs2 = Nothing
End Functioni tried already the byref and byval...
any suggestion wil be appreciated.
thx in advance
here my code and i thnk it nothing happen in loading..
any idea SCBWV
how to use the ADODB.RecordSet.GetRows () /??
Call LockWindowUpdate(ListView2.hwnd) userPriceList1 Call LockWindowUpdate(0&)
any idea SCBWV
how to use the ADODB.RecordSet.GetRows () /??
Hi,
I had a suggestion for you.
You are filling the Listview from table and function (which use table)
I suggest that you create new rs which will hold all your required data and then fill the listview from the rs.
hth
I had a suggestion for you.
You are filling the Listview from table and function (which use table)
I suggest that you create new rs which will hold all your required data and then fill the listview from the rs.
hth
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: VB Project
- Next Thread: vb
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





