Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 4th, 2004, 12:15 PM
Registered User
 
Join Date: Mar 2004
Location: , , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lletnek Send a message via Yahoo to lletnek
Default Printing with default printer

hi im working on a program for a college assignment and i just want to print a few details from some text boxes. a friend of mine gave me some code eg

private sub print_click()

        Printer.Print "Order Number: " & orderNumber.Text
        Printer.Print ""

        Printer.EndDoc

End Sub

but when i go to click print i get error message saying:

Run-time error '424':

Object required

and not being an expert on vb (i hate it but we have to use it lol) i have no clue what to do can anyone shed any light on this thanks a lot :)

Tom Kentell
Website: http://www.lletnek.co.uk
Forum: http://forum.lletnek.co.uk
  #2 (permalink)  
Old March 4th, 2004, 06:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If the error is in the above code, there are only two 'objects': Printer and orderNumber. orderNumber should be a valid component, otherwise you should have got a unknow variable compilation error. This leaves the Printer object, that can be Null if the user login does not have a default printer. Put a breakpoint at the first line of the above code and start with a full compile (Ctrl+F5)

...and not being an expert in English... :-)

Marco


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to retrive paper sizes of default printer gaurikhot .NET Framework 2.0 0 December 6th, 2008 06:23 AM
Default printer anukagni Access 3 March 21st, 2006 08:10 AM
Function for Finding Default Printer smartgir Classic ASP Basics 0 February 7th, 2005 04:02 PM
Determining what default printer is in VBS/WSH dddane VBScript 1 April 30th, 2004 02:08 PM
How to change the default printer donrafeal Pro VB 6 4 April 27th, 2004 11:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.