Results 1 to 9 of 9

Thread: run time error 380

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    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

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    Re: run time error 380

    sorry it not work. and the same massage show again.

  4. #4
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: run time error 380

    Did you Insert 3 columns in the Listview? (right click, properties, Column Headers, Insert 3 Columns)

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    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 Attached Images  

  7. #7
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: run time error 380

    Maybe you added 4 columns insted of 3, delete the firt one.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Location
    Dhaka, Bangladesh
    Posts
    222

    Re: run time error 380

    no. I insert 3. another thing about row. why 1st row hide and 2nd row ?

  9. #9
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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
  •  



Click Here to Expand Forum to Full Width