Trying to Print "Client Receipt" form per client visit

  • Thread starter Thread starter 1encapdiva
  • Start date Start date
1

1encapdiva

Everyone,
I created a button that I want to print a receipt for a client everytime
they visit our clinic. It will print, but not the active record on my client
receipt tab. Any thoughts?
Here's the code I am using:

Private Sub PrintClientReceipt_Click()
On Error GoTo Err_PrintClientReceipt_Click

Dim stDocName As String
Dim MyForm As Form

stDocName = "Client Receipt"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False

Exit_PrintClientReceipt_Click:
Exit Sub

Err_PrintClientReceipt_Click:
MsgBox Err.Description
Resume Exit_PrintClientReceipt_Click

End Sub
 
Trying to print the form is an exercise in frustration. Create a report that
lays out the receipt as you want it for printing, and print that instead.

Once you have the report, here's an example of the code to put in the button
to print it:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html
 
Thank you!!!!
--
bhsvixon


Allen Browne said:
Trying to print the form is an exercise in frustration. Create a report that
lays out the receipt as you want it for printing, and print that instead.

Once you have the report, here's an example of the code to put in the button
to print it:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.




.
 
Back
Top