Checkbox Control VB
Screenshot
The Code
Private Sub cmdExit_Click()
End
End Sub
___________________________________________________
Private Sub cmdShow_Click()
Dim total As Integer
total = 0
tea = ""
sandwitch = ""
pizza = ""
colddrinks = ""
greentea = ""
coffee = ""
If chkTea.Value = 1 Then
tea = " Tea,"
total = total + 5
End If
If chkSandwich.Value = 1 Then
sandwich = " Sandwich,"
total = total + 50
End If
If chkPizza.Value = 1 Then
pizza = " Pizza,"
total = total + 50
End If
If chkColdDrinks.Value = 1 Then
colddrinks = " Cold Drinks,"
total = total + 6
End If
If chkGreenTea.Value = 1 Then
greentea = " Green Tea,"
total = total + 7
End If
If chkCoffee.Value = 1 Then
coffee = " Coffee,"
total = total + 9
End If
MsgBox "You have ordered " & tea & _
sandwich & pizza & colddrinks & greentea & coffee & _
" and the total price is $" & total, vbInformation, "Thanks"
End Sub
Source : http://www.vbtutes.com/2012/08/program-28-restuarant-order-1.html
The Code
Private Sub cmdExit_Click()
End
End Sub
___________________________________________________
Private Sub cmdShow_Click()
Dim total As Integer
total = 0
tea = ""
sandwitch = ""
pizza = ""
colddrinks = ""
greentea = ""
coffee = ""
If chkTea.Value = 1 Then
tea = " Tea,"
total = total + 5
End If
If chkSandwich.Value = 1 Then
sandwich = " Sandwich,"
total = total + 50
End If
If chkPizza.Value = 1 Then
pizza = " Pizza,"
total = total + 50
End If
If chkColdDrinks.Value = 1 Then
colddrinks = " Cold Drinks,"
total = total + 6
End If
If chkGreenTea.Value = 1 Then
greentea = " Green Tea,"
total = total + 7
End If
If chkCoffee.Value = 1 Then
coffee = " Coffee,"
total = total + 9
End If
MsgBox "You have ordered " & tea & _
sandwich & pizza & colddrinks & greentea & coffee & _
" and the total price is $" & total, vbInformation, "Thanks"
End Sub