By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

Print on Form in VBA

P: 89
Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
Dim MyVar
MyVar = "Hello."

Print MyVar

its works in vb6, but it doesnt work in VBA? could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form? Thx a lot
Jan 11 '08 #1
Share this Question
Share on Google+
4 Replies


Dököll
Expert 100+
P: 2,364
Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
Dim MyVar
MyVar = "Hello."

Print MyVar

its works in vb6, but it doesnt work in VBA? could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form? Thx a lot
Hello shaiful!

Are you using our wonderful Access wizard? Access does it all for ya, you probably know this, just mentioning it. You can turn on your wizard and grab the Print Form method there. Provided I know what you are truly referring to.

Please stay tuned if not so...

In a bit!

Dököll
Jan 11 '08 #2

P: 89
Hello shaiful!

Are you using our wonderful Access wizard? Access does it all for ya, you probably know this, just mentioning it. You can turn on your wizard and grab the Print Form method there. Provided I know what you are truly referring to.

Please stay tuned if not so...

In a bit!

Dököll
Hi , thx , actually i cant get any text print on form, thx again
Jan 11 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
It works in vb6, but it doesnt work in VBA?
That's correct! While VBA and VB6 share a lot of functions, they are not the same language! They are not intended to do the same things! Think about it! What reason would a database program have for printing a single line of code? In Access you can print out Forms (although except in a very few specialized situations you shouldn't) and Reports. There's really no reason for a databse program to print out anything else.

And I have no idea what "could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form?" means.

Linq ;0)>
Jan 11 '08 #4

ADezii
Expert 5K+
P: 8,623
Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
Dim MyVar
MyVar = "Hello."

Print MyVar

its works in vb6, but it doesnt work in VBA? could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form? Thx a lot
Linq provided an excellant Response to your question in Post #4. I think you are getting confused with Visual Basic where you can specify CurrentX and CurrentY positions within the context of certain Objects, then start Printing at specific locations. This capability does not exist in VBA, nor should it.
Jan 11 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.