Hi Guys, making great progress thanks to all your help here, however on other question arises;
In a simple way I have a user print a payment slip using a command_button "Docket_Payment", it is protected with a password question, when the user pressed on the button, and gives the right password he is presented with a preview of the report "Payment".
Now I would like to add to the code that if the same button is pressed a different report "Sale" is presented when the checkbox "Sale" is ticked.
I do not know how to get there, to many If Else or other methodology for my knowledge...
Hope someone can help me out..
here is the code I have;
Private Sub Docket_payment_Click()
Dim strPasswd
strPasswd = InputBox("Enter Password", "Restricted Form")
If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If
If strPasswd = "154" Then
Dim strDocName As String
Dim strWhere As String
strDocName = "Payment"
strWhere = "[Docket_Number]=" & Me!Docket_Number
DoCmd.OpenReport strDocName, acPreview, , strWhere
Me.Paid = -1
Else
MsgBox "Sorry, you do not have access to this form", _
vbOKOnly, "Important Information"
Exit Sub
End If
End Sub
In a simple way I have a user print a payment slip using a command_button "Docket_Payment", it is protected with a password question, when the user pressed on the button, and gives the right password he is presented with a preview of the report "Payment".
Now I would like to add to the code that if the same button is pressed a different report "Sale" is presented when the checkbox "Sale" is ticked.
I do not know how to get there, to many If Else or other methodology for my knowledge...
Hope someone can help me out..
here is the code I have;
Private Sub Docket_payment_Click()
Dim strPasswd
strPasswd = InputBox("Enter Password", "Restricted Form")
If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If
If strPasswd = "154" Then
Dim strDocName As String
Dim strWhere As String
strDocName = "Payment"
strWhere = "[Docket_Number]=" & Me!Docket_Number
DoCmd.OpenReport strDocName, acPreview, , strWhere
Me.Paid = -1
Else
MsgBox "Sorry, you do not have access to this form", _
vbOKOnly, "Important Information"
Exit Sub
End If
End Sub