Hey
I've got a msgbox code error, which I can't figure out.. Can anyone help me?
here's the code:
When I run the code, the system gives a Type Mismatch error...
Can anyone plz help me out??
Thanks in advance,
Dennis (Ironis 8) )
I've got a msgbox code error, which I can't figure out.. Can anyone help me?
here's the code:
PHP:
Private Sub E9AMLess6()
Dim space, enc, swim, enc2 As Integer
Dim Response As VbMsgBoxResult
Dim Msg, Msgs, Msgss, Title, Titles, Titless, Style, Styles
space = 18 - (sumEnc9AML + sumEnc9AMT)
enc = (sumEnc9AML + sumEnc9AMT)
swim = (sumSwim9AML + sumSwim9AMT)
enc2 = (sumEnc9AML + sumEnc9AMT + txtNumPers)
Msg = "There are " & space & " spaces available." & _
" There are " & enc & " Encounters and " & swim & " Swims." & _
"Please try another day or time."
Style = vbOKOnly
Title = "Reservation Error"
Msgs = "Are you sure you want to complete this reservation?"
Titles = "Complete Reservation?"
Styles = vbOKCancel + vbCritical + vbDefaultButton1
Msgss = "Reservation successful." & _
" Now there are " & enc2 & " spaces for the Encounter left."
Titless = "Reservation Successful!"
If (sumEnc9AML + sumEnc9AMT + txtNumPers) > 18 Then
If MsgBox(Msg, Style, Title, "", "") = vbOKOnly Then DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Else
Response = MsgBox(Msgs, Styles, Titles, "", "")
If Response = vbCancel Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
MsgBox "Reservation Cancelled", vbOKOnly, "Cancelled", "", ""
Else
MsgBox Msgss, "", Titless, "", ""
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
End If
End If
End Sub
Can anyone plz help me out??
Thanks in advance,
Dennis (Ironis 8) )