Results 1 to 3 of 3

Thread: Listview Type mismatch

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2005
    Location
    West Midlands, UK
    Posts
    33

    Listview Type mismatch

    I have a form on which I have an array of 28 ListView boxes. These are used to display alphabetical lists controlled by a tab strip.

    However when I run the code below which is used to read the data in from a datafile I am presented with the error: Runtime error'13': Type mismatch.

    If any one has an idea what I am doing wrong it will be greatfully received.

    VB Code:
    1. Dim AtoZlstNum As ListItem
    2. Dim AtoZlstLetter(27) As ListItem
    3.  
    4. For a = 1 To NumSongs
    5.   Line Input #1, SongTitle(a)
    6.   If InStr(1, SongTitle(a), ";", vbTextCompare) Then
    7.     SplitText = Split(SongTitle(a), ";", 2, vbTextCompare)
    8.     SongTitle(a) = SplitText(0)
    9.     Set AtoZlstLetter(27) = lstAtoZ(27).ListItems.Add(, , Str(a))
    10.     AtoZlstLetter(27).SubItems(1) = SplitText(1)
    11.   End If
    12.   b = Asc(Left(SongTitle(a), 1))
    13.   If b > 46 And b < 58 Then
    14.     Set AtoZlstNum = lstAtoZ(0).ListItems.Add(, , Str(a))
    15.     AtoZlstNum.SubItems(1) = SongTitle(a)
    16.   Else
    17.     b = b - 64
    18.     Set AtoZlstLetter(b) = lstAtoZ(b).ListItems.Add(, , Str(a))     <- Error occurs here
    19.     AtoZlstLetter(b).SubItems(1) = SongTitle(a)
    20.   End If
    21.   ProgressBar1.Value = a
    22. Next a


    In advance Thank you

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Listview Type mismatch

    Type mismatch means you are passing a string value where numeric value is expected or vice versa...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2005
    Location
    West Midlands, UK
    Posts
    33

    Re: Listview Type mismatch

    I have checked that and does not matter if send number or text same error message produced at the same point.

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