|
-
Jan 3rd, 2011, 02:59 PM
#1
Thread Starter
Member
[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.
-
Jan 3rd, 2011, 03:00 PM
#2
Re: Type MisMAtch
What data-types are each of those variables declared as?
-
Jan 3rd, 2011, 03:12 PM
#3
Thread Starter
Member
Re: Type MisMAtch
they are declared as double..
Thank(^^)
-
Jan 3rd, 2011, 03:15 PM
#4
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.
-
Jan 3rd, 2011, 03:39 PM
#5
Thread Starter
Member
Re: Type MisMAtch
vb Code:
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
-
Jan 3rd, 2011, 04:23 PM
#6
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?
-
Jan 3rd, 2011, 06:58 PM
#7
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|