Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a computer printed check

Status
Not open for further replies.

psybertek

Technical User
Mar 26, 2002
30
US
Hi All,
OK, I use computer printed check's, I am trying to build an app that will take my data and print it on the appropriate check.

I am using a scanned image of one of my checks for the background of my form. Since I don't need that image to print, I set it to visible = false when it prints. I just need the data that I am inputing to show up.

I tried using the printform method, All I get is a grey box no data.( is there a way to make the form visible but transparent)? (I set the text boxes to visible = true), the text boxes are on top of the image box.(so I could line them up correctly)

If I just do printer.print (textbox) then it prints it to the top left corner of the page.

Any help would be greatly appreciated.



CODE FOLLOWS:


green code is the printform method



Option Explicit
Dim Msg

Private Sub cmd_exit_Click()
End
End Sub

Private Sub cmd_print_Click()
Printer.Print Text1.Text
Printer.EndDoc

picture1.visible = false
cmd_print.visible = false
cmd_exit.visible = false
frm_check_printer.printform
picture1.visible = true
cmd_print.visible = true
cmd_exit.visible = true

End Sub

Private Sub Form_Load()

End Sub

Private Sub Label1_Click()

End Sub

Private Sub Picture1_Click()

End Sub

Private Sub Text1_Change()

End Sub

Private Sub Text2_Change()

End Sub

Private Sub Text3_Change()

End Sub

Private Sub Text4_Change()

End Sub

Private Sub Text5_Change()

End Sub

Private Sub Text6_Change()

End Sub

Private Sub Text7_Change()

End Sub



>:):O> Psybertek >:):O>
____________________________
"Computer junkies never die, They just upload."
 
I have done the same thing with receipts. But I used Crystal Reports to get the data on to the receipt. It allowed me to place and format the way I wanted and the receipts print great on special paper.

However if you want to send the information directly to the printer then this might help.

'// Sends the registration information to the printer with some minor formatting.
Printer.PrintQuality = vbPRPQHigh
Printer.Font.name = "Arial"
Printer.Font.Bold = True
Printer.PaperSize = 1 '// 8.5" x 11" paper.
Printer.ScaleLeft = -1000
Printer.Font.Size = 12
Printer.Print vbCrLf & vbCrLf & vbCrLf
Printer.Font.Size = 20
Printer.Print vbTab & vbTab & App.ProductName
Printer.Font.Bold = False
Printer.Font.Size = 14
Printer.Print vbCrLf & vbCrLf & vbCrLf & "REGISTRATION FORM" & vbCrLf
Printer.Print "Fax to: " & LoadResString(153) & LoadResString(154) & vbCrLf
Printer.Print "Date: " & Date
Printer.Print "Product: " & txtProduct.Text
Printer.Print "Version: " & App.Major & "." & App.Minor & "." & App.Revision
Printer.Print "Serial Number: " & txtSerialNumber.Text & vbCrLf
Printer.Font.Size = 12
Printer.Print "Company: " & txtCompany.Text
Printer.Print "Name: " & txtName.Text
Printer.Print "Title: " & txtTitle.Text
Printer.Print "Address 1: " & txtAddress1.Text
Printer.Print "Address 2: " & txtAddress2.Text
Printer.Print "City / Town: " & txtCity.Text
Printer.Print "Province / State: " & cboProvSt.Text
Printer.Print "Country: " & cboCountry.Text
Printer.Print "Postal / Zip Code: " & txtPCZip.Text
Printer.Print "Phone Number: " & txtPhone.Text
Printer.Print "Fax Number: " & txtFax.Text
Printer.Print "E-Mail Address: " & txtEmail.Text & vbCrLf
Printer.Print "Comments: " & txtComments.Text
Printer.EndDoc

With this you will have to play with spaces and carriage returns and line feeds to get the information placed where you want.

However I would recommend using a reporting tool of some sort. It may require some learning but will be easier to maintain and dajust in the future.
Thanks and Good Luck!

zemp
 
Hi Zemp,
Thanx for the response, But I actualy came up with a solution about 2 hours after I posted this question. It's kinda crude looking but it works very well.

Private Sub cmd_print_Click()
frm_check_printer.BackColor = &HFFFFFF
Label2.BackColor = &HFFFFFF
Label1.Visible = False
cmd_print.Visible = False
cmd_exit.Visible = False
cmd_void.Visible = False
cmd_not_void.Visible = False
Text1.BorderStyle = 0
Text2.BorderStyle = 0
Text3.BorderStyle = 0
Text4.BorderStyle = 0
Text5.BorderStyle = 0
Text6.BorderStyle = 0
Text7.BorderStyle = 0
Text8.BorderStyle = 0
frm_check_printer.PrintForm
frm_check_printer.BackColor = &H8000000F
Label2.BackColor = &H8000000F
Label1.Visible = True
cmd_print.Visible = True
cmd_exit.Visible = True
cmd_void.Visible = True
cmd_not_void.Visible = True
Text1.BorderStyle = 1
Text2.BorderStyle = 1
Text3.BorderStyle = 1
Text4.BorderStyle = 1
Text5.BorderStyle = 1
Text6.BorderStyle = 1
Text7.BorderStyle = 1
Text8.BorderStyle = 1
End Sub

I had to play with where all the fields were on the screen.

Again Thanx, I'll try your suggestion, and see what it does.

>:):O> Psybertek >:):O>
____________________________
"Computer junkies never die, They just upload."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top