Simple Newbie Print Problem 
Author Message
 Simple Newbie Print Problem

Say I have simple code that computes the square and cube of the
numbers 1 to 5, and that prints (to screen) each number together with
its square and cube. This works fine as:

Private Sub Command1_Click()
For n = 1 To 5
s = n ^ 2
c = n ^ 3
print n, s, c
Next n
End Sub

But, when I try to print out the results using form1.printform, n, s
and c do not appear in the printed output, only the command buttons
themselves.

What is the easiest way to get this simple data that appears fine on
the screen, to the printer? Must I resort to a database/table for such
a simple output? The controls I know about will only accept a single
item per line not e.g. n,s and c.

What am I missing? Help!

Dennis



Wed, 12 Oct 2005 00:50:56 GMT  
 Simple Newbie Print Problem
Use methods from the Printer Object. See below


Quote:
> Say I have simple code that computes the square and cube of the
> numbers 1 to 5, and that prints (to screen) each number together with
> its square and cube. This works fine as:

> Private Sub Command1_Click()
> For n = 1 To 5
> s = n ^ 2
> c = n ^ 3
> print n, s, c

 Printer.FontBold = True
 Printer.CurrentX = 10
 Printer.CurrentY = 10
 Printer.Print n,s,c

Quote:
> Next n

Printer.EndDoc '   Don't forget this!!!!!!
Quote:
> End Sub

> But, when I try to print out the results using form1.printform, n, s
> and c do not appear in the printed output, only the command buttons
> themselves.

> What is the easiest way to get this simple data that appears fine on
> the screen, to the printer? Must I resort to a database/table for such
> a simple output? The controls I know about will only accept a single
> item per line not e.g. n,s and c.

> What am I missing? Help!

> Dennis



Wed, 12 Oct 2005 11:04:52 GMT  
 Simple Newbie Print Problem
"michael harrington"

 Can you help me with at my question in "comp.lang.basic.visual"?

 The thread title is
" question on syntax to remove items (price value) from the list
called "lstPrice" which is stored in 'lstPrice' when an item (say
necklace) witth the same list index was selected and put into a combox
box called "cboCart" "

Amanda



Wed, 12 Oct 2005 20:05:40 GMT  
 Simple Newbie Print Problem
"michael harrington"

I also decided to post in this group witht he sane thread title - I
should have doen together - but it will take  a while to get posted.



Wed, 12 Oct 2005 20:09:02 GMT  
 Simple Newbie Print Problem
Amanda,

I answered your question about removing items from the listbox.

For this thread:

Note that printing the form assumes that the AutoRedraw property is set to TRUE.
If not, set the AutoRedraw property of the form and try again.

Addy
PATENTEC

Quote:

> "michael harrington"

> I also decided to post in this group witht he sane thread title - I
> should have doen together - but it will take  a while to get posted.



Thu, 13 Oct 2005 04:16:19 GMT  
 Simple Newbie Print Problem
<<snip>>

I got my syntax error fixed.

amanda



Thu, 13 Oct 2005 05:34:49 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Newbie needs help with printing a simple report

2. Newbie: Simple "Printing" to a Form

3. newbie - problem with a simple network connection

4. newbie - problem with a simple network connection

5. Newbie stuck on a simple problem :-P

6. newbie simple?! loop/delay problem

7. HELP - Newbie needs help on simple problem!

8. Newbie problem-simple grid

9. simple/tricky/newbie problem

10. Newbie stuck with really simple problem - Please help.

11. newbie at wits end - please help simple problem

12. newbie to vbscript - simple sorting problem

 

 
Powered by phpBB® Forum Software