print string by access (1 Viewer)

24sharon

Registered User.
Local time
Today, 02:58
Joined
Oct 5, 2004
Messages
147
I have string

I want to print the string and no by report

for example:

dim s as string

s = "hi" & vbcrlf & vbcrlf
s = s & "my name is sharon"


now I want to print the string in the printer
with default font and default size.

is it possible?

thanks!
 

24sharon

Registered User.
Local time
Today, 02:58
Joined
Oct 5, 2004
Messages
147
first of all thanks,

and I agree with you that I have to search.

but

english is not my home language so search and find the exectly what you search is not so easy.
think about it.


second
I try your code in my project and it dont work
is it need some change or it have to work just by copy paste?

(access 2003)
thanks
 

ghudson

Registered User.
Local time
Today, 05:58
Joined
Jun 8, 2002
Messages
6,194
It is possible this will not work if your printer name contains a space.

User this to test the name of your default printer...

Code:
MsgBox Printer.DeviceName, , "Default Printer Name"
 

24sharon

Registered User.
Local time
Today, 02:58
Joined
Oct 5, 2004
Messages
147
My printer have space in the name

so I changed the name of the printer without spaces (picture attach)

and its also dont work.

what do I need?

thanks!
 

Attachments

  • untitled.JPG
    untitled.JPG
    4.8 KB · Views: 108
  • db1.zip
    13.4 KB · Views: 85

ghudson

Registered User.
Local time
Today, 05:58
Joined
Jun 8, 2002
Messages
6,194
I regret that I do not know why it will not work for you. I just opened your attachment and it printed the text string just fine on my printer.

I had the need for the code last week and I searched all of the net until I found what I posted in the sample code section. Try googling and maybe you will have better luck.
 

Users who are viewing this thread

Top Bottom