Login
Search   Moderators Wanted: If you're interested please send your portfolio to info[at]itechforums.com
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 1
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2009, 03:54 AM
N J N N J N is offline
Junior Member
 
Join Date: Sep 2009
Posts: 1
Default

Visual Basic (Run-Time Error 13 Type Mismatch)?


Visual Basic (Run-Time Error 13 Type Mismatch)?

Hey guys, I'm a bit new to Visual Basic, but what I'm trying to do is to perform a calculation on a certain object (in this case, a combo box), which then, based on certain conditions, will display a number on another label.

After putting code for the 2nd combo box in, it begins to display an error runtime error 13 type mismatch.

Here is my code:

Private Sub cmdCalculate_Click()

If cbo1.Text = 12 Then
lbl1 = Val(cbo1.Text * 5)
End If

If cbo1.Text = 13 And cbo1.Text = 19 Then
lbl1 = Val(60 + cbo1.Text)
End If

If cbo1.Text = 20 Then
lbl1 = Val(79 + 0.1 * cbo1.Text)
End If

If cbo2.Text = 12 Then
lbl2 = Val(cbo2.Text * 5)
End If

If cbo2.Text = 13 And cbo2.Text = 19 Then
lbl2 = Val(60 + cbo2.Text)
End If

If cbo2.Text = 20 Then
lbl2 = Val(79 + 0.1 * cbo2.Text)
End If
End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic (Run-Time Error 13 Type Mismatch)? Gail Visual Basic 3 02-28-2010 01:12 PM
Error with Microsoft Visual Basic, Compile error in hidden module: AutoExec. HELP!? ticeeblue Visual Basic 1 02-16-2010 03:11 PM
How do I set the Content-Type for an ASP script written in Visual Basic? LeeJH .Net (ASP.Net, VB.Net, C#) 1 02-03-2010 04:56 AM
Visual Basic identifier expected error? kraetwin Visual Basic 2 09-17-2009 03:41 AM
I have an error while using the Visual Basic 2005 Professional? Mahesh A Visual Basic 0 05-06-2008 04:40 PM

Your Ad Here

All times are GMT. The time now is 03:36 AM.