473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Print on Form in VBA

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
4 2742
Dököll
2,364 Expert 2GB
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
shaiful
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
3,532 Expert 2GB
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
8,834 Expert 8TB
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

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

Similar topics

7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
2
by: Paul Mendez | last post by:
I have a form that consists of 150 records and is still growing. there are times when I want to print a certain record of the form, say record 12. I go to file --> print and choose the page number...
5
by: Darren DeCoste | last post by:
I have an access project with a Form that has a Command button to print the current record. I would like to Print the record 3 times, changing a text field on each print. The standard code of...
3
by: sea | last post by:
I need to be able to print the current form because the form has an embedded object of a .gif file, so report will not work -- does anyone know the way to do this? I tried some code, not sure what...
5
by: Raman | last post by:
Hello friends, I want to print an ID card. I have one Windows Form that contains front and back side. The printer is printing both front and back side at a time. I am trying to send both sides...
2
by: Rodo | last post by:
Hi all, We have a "testing report" form at work that we fill with data (typing for now). The form has a table, other lines and a company logo. I can make a windows form that will get the data...
6
tdw
by: tdw | last post by:
the View Orders form in my Access database has a Print button on it. It has other buttons too, like Edit etc. These buttons used to be at the bottom of the form laid out horizontally, but this was...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
11
by: JWest46088 | last post by:
I'm having difficulty trying to figure out how to print a text file from a hash table one line at a time. I have the text file read into the hash table and can print the text file all at once, but I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.