Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #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 ""


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
Reply With Quote
  #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

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... :-)

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 07:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.