473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Boolean variable Help

9
Hi,

I'm writing a form to get numbers in order to calculate the price. if numbers and the code of business is wrong it will give me message box error.
The result will appear on a rich text box.
My professor wants me to set declare separate string variables to displaying text in the richtextbox.
MY QUESTION :For Boolean variable, assign false to Boolean variable, when user input is invalid. Display results in the richtextbox, when Boolean is true, BUT IF IT IS FALSE : don't display the result.
My out put doesn't calculate the function and don't know how to set the Boolean to not display the output!!

Please help!

Here is my Code:
Expand|Select|Wrap|Line Numbers
  1. 'Declare variables to store the output
  2.         Dim strOutOffice As String = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c")
  3.         Dim strOutVisual As String = "Microsoft Visual Sudio Pro 2010:" & decTotalVS.ToString("c")
  4.         Dim strOutQuick As String = "Intuit Quick Books 2012:" & decTotalQuick.ToString("c")
  5.         Dim strOutMaker As String = "File Maker Pro 2011:" & decTotalMaker.ToString("c")
  6.         Dim strGrandTotal As String = "Grand Total:" & decGrandTotal.ToString("c")
  7.  
  8. Dim blnAnswer As Boolean = True      'Declare a boolean as true
  9.  
  10.  
  11. Process------
  12. .
  13. .
  14. .
  15.  
  16. 'Output ---------------------------------------
  17.         rtbSalesOrder.Clear()
  18.         rtbSalesOrder.AppendText(strOutOffice & vbNewLine)
  19.         rtbSalesOrder.AppendText(strOutVisual & vbNewLine)
  20.         rtbSalesOrder.AppendText(strOutQuick & vbNewLine)
  21.         rtbSalesOrder.AppendText(strOutMaker & vbNewLine)
  22.         rtbSalesOrder.AppendText(strGrandTotal & vbNewLine)
Oct 7 '11 #1
7 1625
Frinavale
9,735 Expert Mod 8TB
So, where is your if statement checking to see if the boolean is true.
It's pretty simple to say:
Expand|Select|Wrap|Line Numbers
  1. Dim myBoolean As Boolean
  2. '.......
  3. If myBoolean = True Then
  4.   'do something
  5. Else
  6.   'do something else...
  7. End If
-Frinny
Oct 7 '11 #2
Nilou
9
Thank you Frinavale,

what would be my Boolean not display the answer in the text box? Do i have to use rtbSalesOrder.Clear()
or there is something else to not to display the output in richTextbox?

is this correct:
Expand|Select|Wrap|Line Numbers
  1. strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
  2.  
  3.  
  4.         If blnAnswer = True Then
  5.  
  6.             rtbSalesOrder.AppendText(strOutOffice)
  7.         Else
  8.             rtbSalesOrder.Clear()
  9.         End If
Oct 7 '11 #3
Frinavale
9,735 Expert Mod 8TB
It's not my project so I'm not sure what you're supposed to display in the TextBox.

According to what you previously posted, I would say that if false then you need to clear the TextBox because you don't want to show anything....

-Frinny
Oct 7 '11 #4
Nilou
9
Here is my Code:
Expand|Select|Wrap|Line Numbers
  1. strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
  2.  
  3.  
  4. If blnAnswer = True Then
  5.   rtbSalesOrder.AppendText(strOutOffice)
  6. Else
  7.   rtbSalesOrder.Clear()
  8. End If
( if it is right, i's not working :(
Oct 7 '11 #5
Frinavale
9,735 Expert Mod 8TB
What about it is not working ?
Oct 7 '11 #6
Nilou
9
no it is not :(((
here is he whole code:
Expand|Select|Wrap|Line Numbers
  1. Public Class SoftwareSales
  2.  
  3.  
  4.     Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
  5.         'Declaration --------------------------
  6.  
  7.         'Declare constants for retail Price
  8.         Const decOffice As Decimal = 500
  9.         Const decVisual As Decimal = 800
  10.         Const decQuick As Decimal = 230
  11.         Const decMaker As Decimal = 300
  12.  
  13.         'Declare variables to store the quantities sold
  14.         Dim shoMsOffice As Short
  15.         Dim shoMsVs As Short
  16.         Dim shoMsQuick As Short
  17.         Dim shoMsMaker As Short
  18.  
  19.         'Declare variables to store the total cost 
  20.         Dim decTotalOffice As Decimal
  21.         Dim decTotalVS As Decimal
  22.         Dim decTotalQuick As Decimal
  23.         Dim decTotalMaker As Decimal
  24.         Dim decGrandTotal As Decimal
  25.  
  26.         Dim strMsBizType As String  'Declare a variable to store business type
  27.  
  28.         'Declare variables to store the applied discount 
  29.         Dim intDisMsOffice As Integer = 1
  30.         Dim intDisMsVs As Integer = 1
  31.         Dim intDisMsQuick As Integer = 1
  32.         Dim intDisMaker As Integer = 1
  33.  
  34.         Dim blnAnswer As Boolean = True      'Declare a boolean as true
  35.  
  36.         'Declare variables to store the output
  37.         Dim strOutOffice As String
  38.         Dim strOutVisual As String
  39.         Dim strOutQuick As String
  40.         Dim strOutMaker As String
  41.         Dim strGrandTotal As String
  42.  
  43.  
  44.  
  45.  
  46.         'Input ----------------------------
  47.  
  48.         strMsBizType = txtBizType.Text
  49.         strMsBizType = strMsBizType.ToUpper
  50.  
  51.         If strMsBizType = "B" Or strMsBizType = "b" Or strMsBizType = "A" Or strMsBizType = "a" Or strMsBizType = "N" Or strMsBizType = "n" Then
  52.             blnAnswer = True
  53.         Else
  54.             MsgBox("Please enter B,A, or N for business type.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  55.  
  56.         End If
  57.  
  58.  
  59.  
  60.         'strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
  61.         'rtbSalesOrder.AppendText(strOutOffice)
  62.  
  63.  
  64.  
  65.  
  66.         If IsNumeric(txtMsOffice.Text) And txtMsOffice.Text > 0 Then
  67.             shoMsOffice = txtMsOffice.Text
  68.         Else
  69.             MsgBox("Please enter number of quantities sold for Microsoft Office Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  70.         End If
  71.  
  72.  
  73.         If IsNumeric(txtMsVs.Text) And txtMsVs.Text > 0 Then
  74.             shoMsVs = txtMsVs.Text
  75.         Else
  76.             MsgBox("Please enter number of quantities sold for Microsoft Visual Studio Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  77.         End If
  78.  
  79.         If IsNumeric(txtMsQuick.Text) And txtMsQuick.Text > 0 Then
  80.             shoMsQuick = txtMsQuick.Text
  81.         Else
  82.             MsgBox("Please enter number of quantities sold for Intuit Quick Books 2012.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  83.         End If
  84.  
  85.         If IsNumeric(txtMsMaker.Text) And txtMsMaker.Text > 0 Then
  86.             shoMsMaker = txtMsMaker.Text
  87.         Else
  88.             MsgBox("Please enter number of quantities sold for File Maker Pro 2011.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  89.         End If
  90.  
  91.  
  92.         'Process -------------------------------------
  93.  
  94.  
  95. .
  96. .
  97. .
  98.  
  99.         'Output ---------------------------------------
  100.  
  101.         rtbSalesOrder.Clear()
  102.  
  103.         strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
  104.         If blnAnswer = True Then
  105.             rtbSalesOrder.AppendText(strOutOffice)
  106.         Else
  107.             rtbSalesOrder.Clear(strOutOffice)
  108.         End If
  109.  
  110.         strOutVisual = "Microsoft Visual Sudio Pro 2010:" & decTotalVS.ToString("c") & vbNewLine
  111.         If blnAnswer = True Then
  112.             rtbSalesOrder.AppendText(strOutVisual)
  113.         Else
  114.             rtbSalesOrder.Clear(strOutVisual)
  115.         End If
  116.  
  117.  
  118.         strOutQuick = "Intuit Quick Books 2012:" & decTotalQuick.ToString("c") & vbNewLine
  119.         If blnAnswer = True Then
  120.             rtbSalesOrder.AppendText(strOutQuick)
  121.         Else
  122.             rtbSalesOrder.Clear(strOutQuick)
  123.         End If
  124.  
  125.         strOutMaker = "File Maker Pro 2011:" & decTotalMaker.ToString("c") & vbNewLine
  126.         If blnAnswer = True Then
  127.             rtbSalesOrder.AppendText(strOutMaker)
  128.         Else
  129.             rtbSalesOrder.Clear(strOutMaker)
  130.         End If
  131.  
  132.  
  133.         strGrandTotal = "Grand Total:" & decGrandTotal.ToString("c") & vbNewLine
  134.         If blnAnswer = True Then
  135.             rtbSalesOrder.AppendText(strGrandTotal)
  136.         Else
  137.             rtbSalesOrder.Clear(strGrandTotal)
  138.         End If
  139.  
  140.         'rtbSalesOrder.Clear()
  141.         'rtbSalesOrder.AppendText("Microsoft Office Pro 2010:" & strOutOffice & vbNewLine)
  142.         'rtbSalesOrder.AppendText("Microsoft Visual Sudio Pro 2010:" & strOutVisual & vbNewLine)
  143.         'rtbSalesOrder.AppendText("Intuit Quick Books 2012:" & strOutQuick & vbNewLine)
  144.         'rtbSalesOrder.AppendText("File Maker Pro 2011:" & strOutMaker & vbNewLine)
  145.         'rtbSalesOrder.AppendText("Grand Total:" & strGrandTotal & vbNewLine)
  146.  
  147.     End Sub
  148.  
  149.     Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
  150.         'Clear UserInput & and assign default values
  151.         txtMsOffice.Text = 0
  152.         txtMsVs.Text = 0
  153.         txtMsQuick.Text = 0
  154.         txtMsMaker.Text = 0
  155.         txtBizType.Text = "B"
  156.         rtbSalesOrder.Clear()
  157.  
  158.         txtMsOffice.Focus()      ' Reset the focus.
  159.     End Sub
  160.  
  161.     Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
  162.         End
  163.     End Sub
  164. End Class
Oct 7 '11 #7
Nilou
9
This one has the process too:

Expand|Select|Wrap|Line Numbers
  1. Public Class SoftwareSales
  2.  
  3.  
  4.     Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
  5.         'Declaration --------------------------
  6.  
  7.         'Declare constants for retail Price
  8.         Const decOffice As Decimal = 500
  9.         Const decVisual As Decimal = 800
  10.         Const decQuick As Decimal = 230
  11.         Const decMaker As Decimal = 300
  12.  
  13.         'Declare variables to store the quantities sold
  14.         Dim shoMsOffice As Short
  15.         Dim shoMsVs As Short
  16.         Dim shoMsQuick As Short
  17.         Dim shoMsMaker As Short
  18.  
  19.         'Declare variables to store the total cost 
  20.         Dim decTotalOffice As Decimal
  21.         Dim decTotalVS As Decimal
  22.         Dim decTotalQuick As Decimal
  23.         Dim decTotalMaker As Decimal
  24.         Dim decGrandTotal As Decimal
  25.  
  26.         Dim strMsBizType As String  'Declare a variable to store business type
  27.  
  28.         'Declare variables to store the applied discount 
  29.         Dim intDisMsOffice As Integer = 1
  30.         Dim intDisMsVs As Integer = 1
  31.         Dim intDisMsQuick As Integer = 1
  32.         Dim intDisMaker As Integer = 1
  33.  
  34.         Dim blnAnswer As Boolean = True      'Declare a boolean as true
  35.  
  36.         'Declare variables to store the output
  37.         Dim strOutOffice As String
  38.         Dim strOutVisual As String
  39.         Dim strOutQuick As String
  40.         Dim strOutMaker As String
  41.         Dim strGrandTotal As String
  42.  
  43.  
  44.  
  45.  
  46.         'Input ----------------------------
  47.  
  48.         strMsBizType = txtBizType.Text
  49.         strMsBizType = strMsBizType.ToUpper
  50.  
  51.         If strMsBizType = "B" Or strMsBizType = "b" Or strMsBizType = "A" Or strMsBizType = "a" Or strMsBizType = "N" Or strMsBizType = "n" Then
  52.             blnAnswer = True
  53.         Else
  54.             MsgBox("Please enter B,A, or N for business type.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  55.  
  56.         End If
  57.  
  58.  
  59.  
  60.         'strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
  61.         'rtbSalesOrder.AppendText(strOutOffice)
  62.  
  63.  
  64.  
  65.  
  66.         If IsNumeric(txtMsOffice.Text) And txtMsOffice.Text > 0 Then
  67.             shoMsOffice = txtMsOffice.Text
  68.         Else
  69.             MsgBox("Please enter number of quantities sold for Microsoft Office Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  70.         End If
  71.  
  72.  
  73.         If IsNumeric(txtMsVs.Text) And txtMsVs.Text > 0 Then
  74.             shoMsVs = txtMsVs.Text
  75.         Else
  76.             MsgBox("Please enter number of quantities sold for Microsoft Visual Studio Pro 2010.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  77.         End If
  78.  
  79.         If IsNumeric(txtMsQuick.Text) And txtMsQuick.Text > 0 Then
  80.             shoMsQuick = txtMsQuick.Text
  81.         Else
  82.             MsgBox("Please enter number of quantities sold for Intuit Quick Books 2012.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  83.         End If
  84.  
  85.         If IsNumeric(txtMsMaker.Text) And txtMsMaker.Text > 0 Then
  86.             shoMsMaker = txtMsMaker.Text
  87.         Else
  88.             MsgBox("Please enter number of quantities sold for File Maker Pro 2011.", MsgBoxStyle.OkOnly + vbCritical, "Data Entry Error")
  89.         End If
  90.  
  91.  
  92.         'Process -------------------------------------
  93.  
  94.         'Discount table for Regular Business 
  95.         If strMsBizType = "B" Or strMsBizType = "b" Then
  96.             decTotalOffice = decOffice * shoMsOffice
  97.             decTotalVS = decVisual * shoMsVs
  98.             decTotalQuick = decQuick * shoMsQuick
  99.             decTotalMaker = decMaker * shoMsMaker
  100.         End If
  101.  
  102.         'Discount table for Academic
  103.         If strMsBizType = "A" Or strMsBizType = "a" Then
  104.  
  105.             If (shoMsOffice = shoMsVs = shoMsQuick = shoMsMaker) <= 10 Then
  106.                 decTotalOffice = shoMsOffice * decOffice
  107.                 decTotalVS = decVisual * shoMsVs
  108.                 decTotalQuick = decQuick * shoMsQuick
  109.                 decTotalMaker = decMaker * shoMsMaker
  110.  
  111.                 Select Case shoMsOffice
  112.                     Case 10 To 19
  113.                         intDisMsOffice = (shoMsOffice * decOffice) * 0.25
  114.                         decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  115.  
  116.                         Select Case shoMsVs
  117.                             Case 10 To 19
  118.  
  119.                                 intDisMsVs = (shoMsVs * decVisual) * 0.25
  120.                                 decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  121.  
  122.                                 Select Case shoMsQuick
  123.                                     Case 10 To 19
  124.                                         intDisMsQuick = (shoMsQuick * decQuick) * 0.05
  125.                                         decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  126.  
  127.                                         Select Case shoMsMaker
  128.                                             Case 10 To 19
  129.                                                 intDisMaker = (shoMsMaker * decMaker) * 0.05
  130.                                                 decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  131.                                         End Select
  132.                                 End Select
  133.                         End Select
  134.                 End Select
  135.  
  136.                 Select Case shoMsOffice
  137.                     Case 20 To 49
  138.                         intDisMsOffice = (shoMsOffice * decOffice) * 0.35
  139.                         decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  140.                         Select Case shoMsVs
  141.  
  142.                         End Select
  143.                     Case 20 To 49
  144.                         intDisMsVs = (shoMsVs * decVisual) * 0.35
  145.                         decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  146.  
  147.                         Select Case shoMsQuick
  148.                             Case 20 To 49
  149.                                 intDisMsQuick = (shoMsQuick * decQuick) * 0.1
  150.                                 decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  151.  
  152.                                 Select Case shoMsMaker
  153.                                     Case 20 To 49
  154.                                         intDisMaker = (shoMsMaker * decMaker) * 0.15
  155.                                         decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  156.                                 End Select
  157.                         End Select
  158.                 End Select
  159.  
  160.                 Select Case shoMsOffice
  161.                     Case 50 To 99
  162.                         intDisMsOffice = (shoMsOffice * decOffice) * 0.5
  163.                         decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  164.  
  165.                         Select Case shoMsVs
  166.                             Case 50 To 99
  167.                                 intDisMsVs = (shoMsVs * decVisual) * 0.5
  168.                                 decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  169.  
  170.                                 Select Case shoMsQuick
  171.                                     Case 50 To 99
  172.                                         intDisMsQuick = (shoMsQuick * decQuick) * 0.15
  173.                                         decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  174.  
  175.                                         Select Case shoMsMaker
  176.                                             Case 50 To 99
  177.                                                 intDisMaker = (shoMsMaker * decMaker) * 0.25
  178.                                                 decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  179.                                         End Select
  180.                                 End Select
  181.                         End Select
  182.                 End Select
  183.  
  184.                 Select Case shoMsOffice
  185.                     Case Is >= 100
  186.                         intDisMsOffice = (shoMsOffice * decOffice) * 0.75
  187.                         decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  188.  
  189.                         Select Case shoMsVs
  190.                             Case Is >= 100
  191.                                 intDisMsVs = (shoMsVs * decVisual) * 0.75
  192.                                 decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  193.  
  194.                                 Select Case shoMsQuick
  195.                                     Case Is >= 100
  196.                                         intDisMsQuick = (shoMsQuick * decQuick) * 0.25
  197.                                         decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  198.  
  199.                                         Select Case shoMsMaker
  200.                                             Case Is >= 100
  201.                                                 intDisMaker = (shoMsMaker * decMaker) * 0.4
  202.                                                 decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  203.                                         End Select
  204.                                 End Select
  205.                         End Select
  206.                 End Select
  207.             End If
  208.         End If
  209.  
  210.  
  211.         'Discount table for NonProfit Organizations
  212.         If strMsBizType = "N" Or strMsBizType = "n" Then
  213.  
  214.             If (shoMsOffice = shoMsVs = shoMsQuick = shoMsMaker) <= 10 Then
  215.                 decTotalOffice = shoMsOffice * decOffice
  216.                 decTotalVS = decVisual * shoMsVs
  217.                 decTotalQuick = decQuick * shoMsQuick
  218.                 decTotalMaker = decMaker * shoMsMaker
  219.             End If
  220.  
  221.             Select Case shoMsOffice
  222.                 Case 10 To 19
  223.                     intDisMsOffice = (shoMsOffice * decOffice) * 0.25
  224.                     decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  225.  
  226.                     Select Case shoMsVs
  227.                         Case 10 To 19
  228.  
  229.                             intDisMsVs = (shoMsVs * decVisual) * 0.25
  230.                             decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  231.  
  232.                             Select Case shoMsQuick
  233.                                 Case 10 To 19
  234.                                     intDisMsQuick = (shoMsQuick * decQuick) * 0.1
  235.                                     decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  236.  
  237.                                     Select Case shoMsMaker
  238.                                         Case 10 To 19
  239.                                             intDisMaker = (shoMsMaker * decMaker) * 10
  240.                                             decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  241.                                     End Select
  242.                             End Select
  243.                     End Select
  244.             End Select
  245.  
  246.             Select Case shoMsOffice
  247.                 Case 20 To 49
  248.                     intDisMsOffice = (shoMsOffice * decOffice) * 0.35
  249.                     decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  250.                     Select Case shoMsVs
  251.  
  252.                     End Select
  253.                 Case 20 To 49
  254.                     intDisMsVs = (shoMsVs * decVisual) * 0.35
  255.                     decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  256.  
  257.                     Select Case shoMsQuick
  258.                         Case 20 To 49
  259.                             intDisMsQuick = (shoMsQuick * decQuick) * 0.25
  260.                             decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  261.  
  262.                             Select Case shoMsMaker
  263.                                 Case 20 To 49
  264.                                     intDisMaker = (shoMsMaker * decMaker) * 0.15
  265.                                     decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  266.                             End Select
  267.                     End Select
  268.             End Select
  269.  
  270.             Select Case shoMsOffice
  271.                 Case 50 To 99
  272.                     intDisMsOffice = (shoMsOffice * decOffice) * 0.45
  273.                     decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  274.  
  275.                     Select Case shoMsVs
  276.                         Case 50 To 99
  277.                             intDisMsVs = (shoMsVs * decVisual) * 0.45
  278.                             decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  279.  
  280.                             Select Case shoMsQuick
  281.                                 Case 50 To 99
  282.                                     intDisMsQuick = (shoMsQuick * decQuick) * 0.4
  283.                                     decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  284.  
  285.                                     Select Case shoMsMaker
  286.                                         Case 50 To 99
  287.                                             intDisMaker = (shoMsMaker * decMaker) * 0.2
  288.                                             decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  289.                                     End Select
  290.                             End Select
  291.                     End Select
  292.             End Select
  293.  
  294.             Select Case shoMsOffice
  295.                 Case Is >= 100
  296.                     intDisMsOffice = (shoMsOffice * decOffice) * 0.6
  297.                     decTotalOffice = (shoMsOffice * decOffice) - intDisMsOffice
  298.  
  299.                     Select Case shoMsVs
  300.                         Case Is >= 100
  301.                             intDisMsVs = (shoMsVs * decVisual) * 0.6
  302.                             decTotalVS = (shoMsVs * decVisual) - intDisMsVs
  303.  
  304.                             Select Case shoMsQuick
  305.                                 Case Is >= 100
  306.                                     intDisMsQuick = (shoMsQuick * decQuick) * 0.5
  307.                                     decTotalQuick = (shoMsQuick * decQuick) - intDisMsQuick
  308.  
  309.                                     Select Case shoMsMaker
  310.                                         Case Is >= 100
  311.                                             intDisMaker = (shoMsMaker * decMaker) * 0.25
  312.                                             decTotalMaker = (shoMsMaker * decMaker) - intDisMaker
  313.                                     End Select
  314.                             End Select
  315.                     End Select
  316.             End Select
  317.         End If
  318.  
  319.  
  320.  
  321.         decGrandTotal = decTotalOffice + decTotalVS + decTotalQuick + decTotalMaker
  322.  
  323.         'Output ---------------------------------------
  324.  
  325.         rtbSalesOrder.Clear()
  326.  
  327.         strOutOffice = "Microsoft Office Pro 2010:" & decTotalOffice.ToString("c") & vbNewLine
  328.         If blnAnswer = True Then
  329.             rtbSalesOrder.AppendText(strOutOffice)
  330.         Else
  331.             rtbSalesOrder.Clear(strOutOffice)
  332.         End If
  333.  
  334.         strOutVisual = "Microsoft Visual Sudio Pro 2010:" & decTotalVS.ToString("c") & vbNewLine
  335.         If blnAnswer = True Then
  336.             rtbSalesOrder.AppendText(strOutVisual)
  337.         Else
  338.             rtbSalesOrder.Clear(strOutVisual)
  339.         End If
  340.  
  341.  
  342.         strOutQuick = "Intuit Quick Books 2012:" & decTotalQuick.ToString("c") & vbNewLine
  343.         If blnAnswer = True Then
  344.             rtbSalesOrder.AppendText(strOutQuick)
  345.         Else
  346.             rtbSalesOrder.Clear(strOutQuick)
  347.         End If
  348.  
  349.         strOutMaker = "File Maker Pro 2011:" & decTotalMaker.ToString("c") & vbNewLine
  350.         If blnAnswer = True Then
  351.             rtbSalesOrder.AppendText(strOutMaker)
  352.         Else
  353.             rtbSalesOrder.Clear(strOutMaker)
  354.         End If
  355.  
  356.  
  357.         strGrandTotal = "Grand Total:" & decGrandTotal.ToString("c") & vbNewLine
  358.         If blnAnswer = True Then
  359.             rtbSalesOrder.AppendText(strGrandTotal)
  360.         Else
  361.             rtbSalesOrder.Clear(strGrandTotal)
  362.         End If
  363.  
  364.         'rtbSalesOrder.Clear()
  365.         'rtbSalesOrder.AppendText("Microsoft Office Pro 2010:" & strOutOffice & vbNewLine)
  366.         'rtbSalesOrder.AppendText("Microsoft Visual Sudio Pro 2010:" & strOutVisual & vbNewLine)
  367.         'rtbSalesOrder.AppendText("Intuit Quick Books 2012:" & strOutQuick & vbNewLine)
  368.         'rtbSalesOrder.AppendText("File Maker Pro 2011:" & strOutMaker & vbNewLine)
  369.         'rtbSalesOrder.AppendText("Grand Total:" & strGrandTotal & vbNewLine)
  370.  
  371.     End Sub
  372.  
  373.     Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
  374.         'Clear UserInput & and assign default values
  375.         txtMsOffice.Text = 0
  376.         txtMsVs.Text = 0
  377.         txtMsQuick.Text = 0
  378.         txtMsMaker.Text = 0
  379.         txtBizType.Text = "B"
  380.         rtbSalesOrder.Clear()
  381.  
  382.         txtMsOffice.Focus()      ' Reset the focus.
  383.     End Sub
  384.  
  385.     Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
  386.         End
  387.     End Sub
  388. End Class
Oct 7 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: asim | last post by:
Hi if a declare a variale say Dim Flag and assing it to true a boolean value Flag = True and if i try to concatinate it with another string like mystr="<my-str>" & Flag & "</my-str>" and if...
10
by: Tjerk Wolterink | last post by:
The following code does not work: <xsl:variable name="width" select="form:image-width"/> <xsl:if test="$width>$max_image_width"> <xsl:variable name="width" select="$max_image_width"/> </xsl:if>...
1
by: leegold | last post by:
Show full header Is there any way to make relevance when using boolean mode more useful? If not, are there plans in the Fulltext development "todo" for making it useful? I'm thinking of just...
4
by: comp.lang.php | last post by:
This is an urgent request (as always) generate_admin_customer_position_dropdown($customerResult, $customerResult->id); print_r($_SESSION); This code will generate an HTML dropdown as...
2
by: billelev | last post by:
In other languages it's possible to prefix a boolean with a "!" to invert it, however this doesn't seem to work in VBA. Is there an alternative in VBA? I'd like the flexibility to do something...
1
by: shiniskumar | last post by:
how to check if the value of a boolean variable is true of false in ftl? ive got a boolean variable whose value is false i have to perform some action based on its value in front end how do i...
2
by: kofler4404 | last post by:
I wanted to know whether or not one should expect that the assignment and reading of boolean values (the type bool in c++) is thread safe. I am using the latest release of pthreads on windows xp...
1
by: Curious | last post by:
I have following code: void DownloadLists () { if (!mIsListsDownloaded) { // Loop -- Downloading entries for each list foreach (ITritonList list in
1
by: Tony Johansson | last post by:
Hello! What can the reason be for making a System.Boolean as big as 4 bytes. It's only true or false. I imagine the variable type of a boolean could have been made much smaller. //Tony
1
by: Robert Nash | last post by:
!(1 && !(0 || 1)) Why is this true? I just can't see it. I would appreciate any help at all. I realise it's probably easy for you.
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.