Trying to Print "Client Receipt" form per client visit

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
 
A

Allen Browne

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
 
1

1encapdiva

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.




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top