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

Posts: 79
Location: USA
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!
__________________
>> Higher a poor college student. PM me :). PHP/MySQL <<
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
When You Register, These Ads Go Away!
     
Reply     « Reply to Coding Error Help :)
 

Thread Tools

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
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.10890 seconds with 13 queries