Solved

can't print form image to this type of printer in vb6

Posted on 2013-11-22
4
458 Views
Last Modified: 2013-11-22
I have the following vb6 code.

If MsgBox("This record has been saved.  Would you like to print?", vbYesNo Or vbQuestion, "Print Record") = vbYes Then
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB.PrintForm
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB2.PrintForm
End If

Open in new window



I get the error on line 5 "can't print form image to this type of printer"

Why is this happening?
0
Comment
Question by:al4629740
  • 2
4 Comments
 
LVL 45

Expert Comment

by:Martin Liss
ID: 39670797
What is your default printer?
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 39670831
make a call to the Printer.EndDoc method after each PrintForm method call :

If MsgBox("This record has been saved.  Would you like to print?", vbYesNo Or vbQuestion, "Print Record") = vbYes Then
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB.PrintForm
    Printer.EndDoc
    Printer.Orientation = vbPRORLandscape
    frmRegistrationSYAB2.PrintForm
    Printer.EndDoc
End If

Open in new window


http://support.microsoft.com/kb/242483
0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 39670837
Does the printer have the ability to print landscape?
0
 

Author Closing Comment

by:al4629740
ID: 39670920
That worked.  Thanks!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now