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

Printing an invoice using vb6 and access

Status
Not open for further replies.

fareezf

Programmer
Oct 26, 2003
20
CA
Hi,

How can I design & print an invoice with it's contents based on two different Access 2000 tables. Also it has some fields which the user will type before printing (e.g. 'Purchase Order No.', 'Boxes' etc.).

Any help will be appreciated.

Fareez...
 

There are several ways to accomplish this and here is just a few.

You can create a form that will look like the final invoice with the data entry fields that you want and use Me.PrintForm (set me.backcolor = vbwhite prior to printing).


You can collect the information and...

use the printer object to draw the invoice to the printer.

use a reporting package like crystal reports to print the invoice out.


Good Luck

 
You could also use a datareport or use the Word object model

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Hi,

I cannot use the tip vb5prgrmr gave because I don't have Crystal Reports.

As for johnwm's tip please could you tell me whether I can acheive the following if I use the Word object model.

If I design the invoice in Word how do I retreive the proper data from the database table to the appropriate place in the Word?

Fareez...
 
1. Design your invoice in Word, inserting Bookmarks where each datafield will go.

2. Step through the recordset inserting fields into the appropriate bookmarks.

For further details do a Keyword Search (tab at top of this page) for 'Word model', 'Exact phrase' in this forum and in forum222 as the details have been done several times

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Johnwm,

Sorry to trouble you again but I did a keyword search on 'word model' and nothing came but I visited the thread and found some tips. But all of them showed how to open a word or print a word app from vb.

I opened a word document and inserted some bookmarks. But I am clueless as to how I can get the data from my access table and put it in those bookmarks. In the bookmarks do I have to set a formula? Could you please help me because I have seen your name in most of the complicated cases and how you have helped the other guys.
 
I've just had a quick look through some old posts. thread222-678481 discusses opening a copy of Word. thread709-623084 gives details of inserting data into a table in a Word doc from VB
Start with these and see how you get on.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top