View Single Post
Old Mar 6, 2003 | 05:49 PM
  #1  
hondav6's Avatar
hondav6
Senior Member
 
Joined: Jul 2002
Posts: 1,119
Likes: 0
From: La Plata, Maryland
Default Any one good at Visual Basic??

Cause I need some help trying to figure out why my program is not working properly. The program is supposed to give you the total amount due for the number of people registered for an event. You have two option buttons, one check box and a text entry box.

My problem is getting the check box recognized so that a discount can be applied to the total bill. Here is the code:

Private Sub cmdCalc_Click()

Dim Seminar1, Seminar2, Discount As Single
Dim Total_Seminar1, Total_Seminar2, TotDis_Seminar1, TotDis_Seminar2 As Single

Seminar1 = 425
Seminar2 = 550
Discount = 0.9

Total_Seminar1 = Val(txtReg.Text) * Seminar1
Total_Seminar2 = Val(txtReg.Text) * Seminar2
TotDis_Seminar1 = Total_Seminar1 * Discount
TotDis_Seminar2 = Total_Seminar2 * Discount

If Option1.Value = True Then
lblTotal.Caption = FormatCurrency(Total_Seminar1)
End If

If (Option1.Value = True) And (chkDisc.Value = True) Then
lblTotal.Caption = FormatCurrency(TotDis_Seminar1)
End If

If Option2.Value = True Then
lblTotal.Caption = FormatCurrency(Total_Seminar2)
End If

If (Option2.Value = True) And (chkDisc.Value = True) Then
lblTotal.Caption = FormatCurrency(TotDis_Seminar2)
End If

End Sub


Anyone have any clue as to what I have wrong with this? Because when I run the program, My answer comes up in the label box where it is supposed to, but when i click on the box for the discount and press the caluclate button, i get the same answer. Any suggestions?

Greg
Reply