Doing Something Wrong with a print button

T

tdhelge

OK Guys, I need a little help here and I know this is a simple fix but I'm
obviously over looking the problem. All I want to do is add a print button to
the bottom of my form to print out the current customer workorder. Here is
what I have for the VB code under the "On_click" event

Private Sub Command18_Click()
On Error GoTo Err_Command18_Click
DoCmd.PrintOut
DoEvents
DoCmd.Close
Exit_Command18_Click:
Exit Sub
Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click
End Sub

Command_18 it the print button itself. I would also like it to NOT have the
"Print" button show on the printed document.

Any ideas what I'm doing wrong here?
 
D

Douglas J. Steele

One of the things you're doing wrong is printing forms. Forms are meant for
user interaction, reports are meant for printing.

Fortunately, it's easy to save a form as a report.
 
T

Ted Helgeson

I guess thats what I meant was a report not a form, sorry for the confusion.

I have it laid out so that all of the customer info is global so that its a
seamless link to the invoice and workorder. By using a switchboard, contact
info is put into the database, from there a workorder and/or invoice can be
generated. So what would be the easiest way to set it up to print the invoice
and workorder from there?
 
D

Douglas J. Steele

Assuming you've got a form where the user can select the invoice and/or
workorder, put a button on that form, and have its OnClick event use the
OpenReport method to open the report, providing an appropriate
WhereCondition to limit the report to the specific item(s) of interest.
 

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