I need some help in Microsoft Visual Basics 6.0. Here is my layout so far.
Note: txtFirstType, txtFirstAmount, txtSecondType, txtSecondAmount and txtName are the names that I assigned to the respective text boxes.
Here is my program for my "Receipt Button" (circled in red in the picture)
Dim iChocolate As Integer
Dim iVanilla As Integer
Dim iMint As Integer
Dim iBeforeTax As Integer
Option Explicit
Private Sub cmdReceipt_Click()
If txtFirstType.Text = "C" Then
iChocolate = Val(txtFirstAmount.Text)
ElseIf txtFirstType.Text = "V" Then
iVanilla = Val(txtFirstAmount.Text)
ElseIf txtFirstType.Text = "M" Then
iMint = Val(txtFirstAmount.Text)
End If
If txtSecondType.Text = "C" Then
iChocolate = Val(txtSecondAmount.Text)
ElseIf txtSecondType.Text = "V" Then
iVanilla = Val(txtSecondAmount.Text)
ElseIf txtSecondType.Text = "M" Then
iMint = Val(txtSecondAmount.Text)
End If
lblOutput.Caption = "Customer's Name : " & txtName.Text _
& vbNewLine _
& "Chocolate Cookies = " & "iChocolate" _
& vbNewLine _
& "Vanilla Cookies = " & "iVanilla" _
& vbNewLine _
& "Mint Cookies = " & "iMint" _
& vbNewLine _
& "Subtotal = " & iChocolate * 5.99 + iVanilla * 5.49 + iMint * 6.49 _
& vbNewLine _
& iBeforeTax = iChocolate * 5.99 + iVanilla * 5.49 + iMint * 6.49 _
& "PST For Order = " & iBeforeTax * 0.08 _
& vbNewLine _
& "GST For Order = " & iBeforeTax * 0.07 _
& vbNewLine _
& "Grand Total = " & iBeforeTax * 1.15
End Sub
Now the problem is that after I run my visual basics program, no matter what input I enter in the text boxes, my lblOutput textbox is always False. The only thing it shows is the word False after I click on the Recipt Button. What I'm trying to do is make something like the following appear in the Output label:
Customer's Name : James
Chocolate Cookies = 5
Vanilla Cookies = 7
Mint Cookies = 4
etc...
Thanks for any help!