Results 1 to 7 of 7

Thread: [RESOLVED] Type MisMAtch

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2010
    Posts
    40

    Resolved [RESOLVED] Type MisMAtch

    HelloEveryone...


    I hve been trying tofigure out wht is wrong with this codes:



    "Private Sub ListView1_Click()
    Dim w, m, r, t, u, I, l As Double

    r = Val(ListView1.SelectedItem.SubItems(1))
    t = Val(ListView1.SelectedItem.SubItems(2))
    u = Val(ListView1.SelectedItem.SubItems(3))
    I = Val(ListView1.SelectedItem.SubItems(4))
    l = Val(ListView1.SelectedItem.SubItems(5))
    m = Val(ListView1.SelectedItem.SubItems(6))

    w = r + t + u + I + l + m

    Text8=w
    Text9 = ListView1.SelectedItem.SubItems(8)

    End Sub"




    I got the error: Type mismatch and it highlight this prt: w = r + t + u + I + l + m
    Last edited by ailensamson; Jan 3rd, 2011 at 03:12 PM.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Type MisMAtch

    What data-types are each of those variables declared as?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2010
    Posts
    40

    Re: Type MisMAtch

    they are declared as double..


    Thank(^^)

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Type MisMAtch

    I'm in doubt. Please post that routine so we can see your actual code & include the variable declarations if they are outside of that routine.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2010
    Posts
    40

    Re: Type MisMAtch

    vb Code:
    1. Private Sub ListView1_Click()
    2. Dim w, m, r, t, u, I, l As Double
    3.  
    4. r = Val(ListView1.SelectedItem.SubItems(1))
    5. t = Val(ListView1.SelectedItem.SubItems(2))
    6. u = Val(ListView1.SelectedItem.SubItems(3))
    7. I = Val(ListView1.SelectedItem.SubItems(4))
    8. l = Val(ListView1.SelectedItem.SubItems(5))
    9. m = Val(ListView1.SelectedItem.SubItems(6))
    10.  
    11. w = r + t + u + I + l + m
    12.  
    13. Text8=w
    14. Text9 = ListView1.SelectedItem.SubItems(8)
    15.  
    16. End Sub

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Type MisMAtch

    In VB the following does not declare each variable as a double
    Dim w, m, r, t, u, I, l As Double

    This does
    Dim w As Double, m As Double, r As Double, t As Double, u As Double, I As Double, l As Double

    Did that fix it?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 2010
    Posts
    40

    Re: Type MisMAtch

    Yes... Thank you so much!!!!!

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