Jun 16th, 2010, 12:45 AM
#1
Thread Starter
Addicted Member
run time error 380
I use the below code but a error massage show: "Invalid property value"
Code:
Dim RsL As New ADODB.Recordset
Dim sqlEmp As ListItem
LvwAddEmployees.ListItems.Clear
If RsL.State = 1 Then RsL.Close
RsL.CursorLocation = adUseClient
RsL.Open "Select * from Accounts", GConn, 3, 4
If (RsL.RecordCount > 0) Then
RsL.MoveFirst
End If
While Not RsL.EOF
Set sqlEmp = LvwAddEmployees.ListItems.Add(, , RsL!SrNo)
sqlEmp.SubItems(2) = RsL!AccountName
sqlEmp.SubItems(3) = RsL!OpeningBalance
RsL.MoveNext
Wend
Set RsL = Nothing
Jun 16th, 2010, 01:28 AM
#2
Re: run time error 380
In your Listview you have 1 Listitem and 2 Subitems? If so, those Subitems indexes are 1 and 2, not 2 and 3 (subitem 3 doen't exist that's the reason of this error), so it should be:
Code:
While Not RsL.EOF
Set sqlEmp = LvwAddEmployees.ListItems.Add(, , RsL!SrNo)
sqlEmp.SubItems(1 ) = RsL!AccountName
sqlEmp.SubItems(2 ) = RsL!OpeningBalance
RsL.MoveNext
Wend
Jun 16th, 2010, 02:01 AM
#3
Thread Starter
Addicted Member
Re: run time error 380
sorry it not work. and the same massage show again.
Jun 16th, 2010, 02:09 AM
#4
Re: run time error 380
Did you Insert 3 columns in the Listview? (right click, properties, Column Headers, Insert 3 Columns)
Jun 16th, 2010, 02:48 AM
#5
Re: run time error 380
I haven't had my early morning coffee yet
Could you exactly point out which line is giving you the error?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear :
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
Jun 16th, 2010, 04:37 AM
#6
Thread Starter
Addicted Member
Re: run time error 380
now it work (insert 3 column) but 1st row not show and the 2nd row r same. and it show extra 2 column before Account Name. how can I solve it.
Attached Images
Jun 16th, 2010, 04:55 AM
#7
Re: run time error 380
Maybe you added 4 columns insted of 3, delete the firt one.
Jun 16th, 2010, 06:39 AM
#8
Thread Starter
Addicted Member
Re: run time error 380
no. I insert 3. another thing about row. why 1st row hide and 2nd row ?
Jun 16th, 2010, 09:53 AM
#9
Re: run time error 380
upload your form for a faster resolution.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear :
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width