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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PRINTING PROBLEM

Status
Not open for further replies.

compcad

Programmer
Mar 22, 2002
52
US
i need some help i am designing a program that prints some tickets it worked fine about 2 weeks ago. it would print perfectly. after coming back to it after 2 weeks such as yesterday it would not print any more. it would send out a blank sheet and then the print document icon in the taskbar would close. i tried printing other things and it would print ok. i have an HP 882C DESKJET it won't even print to a PDF it comes out blank. here is a sample of part of the code. i also am using VB6

If Dir$(DataPath) > "" Then
Data1.DatabaseName = DataPath
'Access password.
Data1.Connect = ";PWD=TheSecretPassword"
Else
MsgBox "The file WHDATA.MDB is not" & _
Chr$(10) & "located in this directory" & _
Chr$(10) & DataPath1a, vbInformation, "TRY AGIAN"
GoTo annuleren
End If
'Messagebox stating if database
'is in the designated folder.
'Takes you back to the main screen.
Form1.Visible = False
'Print dialog loads up.
CommonDialog1.Flags = cdlPDNoSelection
CommonDialog1.CancelError = True
On Error GoTo annuleren
CommonDialog1.ShowPrinter
Dim a As Integer
Dim X As Integer
Dim Sum As Integer
Dim number As Integer
Dim Y As Integer
Dim nIndex
Dim tickets
Dim pages
Dim nLong As String
Dim mLong As String
'SQL statements to access the
'database.

If txtTickets = "" Then
MsgBox "ENTER a value of 4 through MAX in the in the NumberofTicketsAvailable field located in the RAFFLES table. Please see the Administrator.", vbExclamation + vbOKOnly, "Please try again"
GoTo annuleren
ElseIf txtTickets < 4 Then
MsgBox &quot;ENTER a value of 4 through MAX in the in the NumberofTicketsAvailable field located in the RAFFLES table. Please see the Administrator.&quot;, vbExclamation + vbOKOnly, &quot;Please try again&quot;
GoTo annuleren
ElseIf txtTickets > 4000 Then
MsgBox &quot;ENTER a value of 4 through MAX in the in the NumberofTicketsAvailable field located in the RAFFLES table. Please see the Administrator.&quot;, vbExclamation + vbOKOnly, &quot;Please try again&quot;
GoTo annuleren
End If
txtTickets = txtTickets
pages = txtTickets / 4
For X = 1 To pages
a = 200
For nIndex = X To tickets Step pages
Printer.Print
'Prints the Address form on the
'ticket.
Printer.PaintPicture picAddress, 7600, a + 500, 4000, 2500
'Prints a line down the right side.
Y = Printer.CurrentY
Printer.Line (7222, 15500)-(7222, 25)
Printer.Line (7223, 15500)-(7223, 25)
Printer.CurrentX = Y
Printer.ForeColor = QBColor(15)
Printer.Print Format$(nIndex, &quot;0000&quot;)
Data1.RecordSource = number1 'Charity
Data1.Refresh
Printer.CurrentX = 300
Printer.CurrentY = a
Printer.ForeColor = QBColor(0)
Printer.Font.Size = 11
Printer.Print &quot;&quot;
Printer.Font.Name = &quot;arial&quot;
Printer.Font.Size = 17
'Charity line.
Printer.CurrentX = (6900 \ 1 - Printer.TextWidth(txtText)) \ 2
Printer.Print txtText
Printer.Font.Size = 5

THANK YOU
STEPHEN MENTZER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top