J
jesseu via AccessMonster.com
New to code, I can get the message box to open, but cannot get the report to
open when I click the Yes Buttom. Can anyone see what I have done wrong with
the code.
Thank You
Jesse
Private Sub Form_AfterInsert()
Dim Msg, Style, Title, MyString
Msg = "Would You Like To Print Label" ' Define message.
Style = 4 + 16 + 0 ' Define buttons.
Title = "ESS Label" ' Define title.
Dim stDocName As String
If Me![Text6] = 3 - 1 Then
Response = MsgBox(Msg, Style, Title)
ElseIf Response = vbYes Then ' User chose Yes.
MyString = "Yes"
DoCmd.OpenReport "person" ' Perform some action.
Else ' User chose No.
MyString = "No"
' Perform some action.
End If
End Sub
open when I click the Yes Buttom. Can anyone see what I have done wrong with
the code.
Thank You
Jesse
Private Sub Form_AfterInsert()
Dim Msg, Style, Title, MyString
Msg = "Would You Like To Print Label" ' Define message.
Style = 4 + 16 + 0 ' Define buttons.
Title = "ESS Label" ' Define title.
Dim stDocName As String
If Me![Text6] = 3 - 1 Then
Response = MsgBox(Msg, Style, Title)
ElseIf Response = vbYes Then ' User chose Yes.
MyString = "Yes"
DoCmd.OpenReport "person" ' Perform some action.
Else ' User chose No.
MyString = "No"
' Perform some action.
End If
End Sub