Private Sub chktop_Click(Index As Integer)
'read toppings
PizzaTop = chktop(Index).Caption
End Sub
Private Sub cmdBuild_Click()
'message box
Dim message As String
Dim message2 As String
Dim I As Integer
Dim b As Double
Dim e As Double
Dim PizzaSize As String
Dim PizzaCrust As String
Dim PizzaWhere As String
If PizzaSize = small Then
b = 17
message = "Small" + "$17.00" + vbCr
End If
If PizzaSize = medium Then
b = 22
message = "Medium" + "$22.00" + vbCr
End If
If PizzaSize = large Then
b = 27
message = "Large" + "$27.00" + vbCr
End If
If PizzaWhere = eatin Then
b = b + 5
message = message + "EatIn" + "$5.00" + vbCr
Else
If PizzaWhere = takeout Then
message = message + "TakeOut" + "$0.00" + vbCr
End If
End If
message = message + PizzaCrust + vbCr
For I = 0 To 6
If chktop(I).Value = vbChecked Then message = message + chktop(I).Caption + "$1.25" + vbCr
If chktop(I).Value = vbChecked Then b = b + 1.25
Next I
e = (b * 0.125) + b
message2 = message & "Your Total is " & e
MsgBox message2, vbOKOnly, "Your Pizza"
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub Form_Load()
'initialize pizza parameters
PizzaSize = "Small"
PizzaCrust = "Thin Crust"
PizzaWhere = "Eat In"
End Sub
Private Sub optCrust_Click(Index As Integer)
'read crust
PizzaCrust = optCrust(Index).Caption
End Sub
Private Sub optSize_Click(Index As Integer)
'read pizza size
PizzaSize = optSize(Index).Caption
End Sub
Private Sub optWhere_Click(Index As Integer)
'read Pizza eating location
PizzaWhere = optWhere(Index).Caption
End Sub
Jawow
0
Newbie Poster
Recommended Answers
Jump to PostI got a problem getting my code to function
That's a darned shame. If you want help then tell us what isn't working the way you'd like. What is your code supposed to do? Any error messages? If so then on what line?
Jump to PostDid wrote this function to button.................
?
All 7 Replies
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Dili1234
-2
Junior Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Dili1234
-2
Junior Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Dili1234
-2
Junior Poster
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.