Fill Paid field with yes

Marinus

I'm learning... :)
Local time
Today, 14:29
Joined
Jun 16, 2010
Messages
140
Hi Guys, Newbie again, with a small thing.. I have a payment command button on my form and when pressed this prints a report, when printed is there a way to update my Paid field to Yes?

The Code;

Private Sub Docket_payment_Click()
'Attached to On Click event of Docket_Payment

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

'Check to see if there is any entry made to input box, or if
'cancel button is pressed. If no entry made then exit sub.

If strPasswd = "" Or strPasswd = Empty Then
MsgBox "No Input Provided", vbInformation, "Required Data"
Exit Sub
End If

'If correct password is entered print preview Payment report
'If incorrect password entered give message and exit sub

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
Else
MsgBox "Sorry, you do not have access to this form", _
vbOKOnly, "Important Information"
Exit Sub
End If
End Sub
 
If your paid field is a text box you can use the following in your Button's On Click event;
Code:
Me.PaymentField = "Yes"
If it is a check box use;
Code:
Me.PaymentField = -1
 
Thanks John, Works perfect....
 

Users who are viewing this thread

Back
Top Bottom