[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Common dialog problem

Posted on 2000-03-01
2
Medium Priority
?
163 Views
Last Modified: 2010-05-02
Hi i am using the commondialog control to do a simple print of a form. I am using vb6 service pack 3

now when i display the print dialog box with, if i press cancel, it still sends the job to the printer, how can i stop it from going to the print que and get the cancel to work properly

thanx in advance

:)

CRaig
0
Comment
Question by:CraigLazar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
p_biggelaar earned 90 total points
ID: 2573154
Make sure you set CancelError to true

Either use On error resume next or On error goto to trap errornumber 32755 (Cancel selected)

Example:

CommonDialog1.CancelError = True
On Error Resume Next

CommonDialog1.ShowPrinter
If Err = 32755 Then 'Cancel pressed
  'Do what you want, but don't print
Elseif Err=0 then
  'Print
Else
  'There was another error
End If

I admit the example is not the recommended way to program, but it is meant to give you an idea of how to determine that Cancel was pressed.
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 2594788
Thanx
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 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