Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
Old 10-10-2007, 03:48 PM Coding Error Help :)
Red_X_'s Avatar
Extreme Talker

Posts: 153
Location: Houston
Trades: 0
Code:
  Dim type As String
        Dim Number As String
        Dim Math As Decimal




        If String.IsNullOrEmpty(txtType.Text) Then
            MessageBox.Show("Error! Please insert a W or R.", _
                "Marine Packing", MessageBoxButtons.OK, _
                    MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
        Else
            type = txtType.Text
            If type = "W" And 1 >= 4 Then
                type = CStr(10)
            ElseIf type = "W" And 5 >= 5 Then
                type = CStr(9)
            Else
                type = CStr(0)
            End If
            If type = "R" And 1 >= 3 Then
                type = CStr(15)
            ElseIf type = "R" And 4 >= 8 Then
                type = CStr(14)
            ElseIf type = "R" And 8 >= 8 Then
                type = CStr(12)
            Else
                type = CStr(0)
            End If

            If IsNumeric(txtUnits.Text) Then
                Number = txtUnits.Text
            Else
                Number = CStr(0)
                MessageBox.Show("Error Data is 0.", _
                    "Marine Packing", MessageBoxButtons.OK, _
                        MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
            End If




        End If

        Math = CDec(CDbl(Number) * CDbl(type))
        lblDue.Text = Math.ToString("C2")
    End Sub
I'm trying to get my form to get the variable "Type" from the entered digit of W or R with the values assigned from there entry. But every time I try, my result always ends up staying zero.

Any help would be greatly appretiated!
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Reply     « Reply to Coding Error Help :)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.07655 seconds with 12 queries