Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pizza Application

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0

In my Pizza Application why can't I get the MsgBox function to add the "Extra's" What coding is missing?
Thanks for any help!

Private Sub cmdOrder_Click()
MsgBox ("Your Pizza will have")
If chkmushrooms.Value = 1 Then
msg = msg & "Extra Mushrooms"
End If
If chkHam.Value = 1 Then
msg = msg & "Extra Ham"
End If
If chkSpicy.Value = 1 Then
msg = msg & "Extra Hot'n'Spicy"
End If
End Sub
 
Try this:

Private Sub cmdOrder_Click()
Dim msg As String
Dim blextra As Boolean
msg = "Your Pizza will have: " & vbCrLf
If chkmushrooms.Value = 1 Then
msg = msg & "Extra Mushrooms" & vbCrLf
blextra = True
End If
If chkHam.Value = 1 Then
msg = msg & "Extra Ham" & vbCrLf
blextra = True
End If
If chkSpicy.Value = 1 Then
msg = msg & "Extra Hot'n'Spicy" & vbCrLf
blextra = True
End If
If Not blextra Then
msg = msg & "Nothing extra."
End If
MsgBox msg
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top