473,326 Members | 2,111 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,326 software developers and data experts.

How to print screen in Access

I have a form which has one to many kind of display actually it is Appointments page for an employee and an emploee may have a number of appointments in the past which all are listed here in the form.

When I try to print this form thru a Macro ( PrintOut) it prints an many times as the number of appointments.

So how to make it print it just once. i mean actually it should do Kind of PrintScreen type.

Any Help will be appreciated,
Thanks,
Archana
Jun 5 '07 #1
4 20992
ADezii
8,834 Expert 8TB
I have a form which has one to many kind of display actually it is Appointments page for an employee and an emploee may have a number of appointments in the past which all are listed here in the form.

When I try to print this form thru a Macro ( PrintOut) it prints an many times as the number of appointments.

So how to make it print it just once. i mean actually it should do Kind of PrintScreen type.

Any Help will be appreciated,
Thanks,
Archana
PrintOut can be a little quirky, so here is a little trick, that will always Print 'only' the Current Record on a Form:
  1. Filter on the Primary Key Field on your Form.
  2. Set FilterOn = True.
  3. Print the single Form Record.
  4. Remove the Filter (FilterOn = False).
  5. You can even return to the Record that you Printed if you so desired.

Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[Product ID]=" & Me![txtProductID]
  2. Me.FilterOn = True
  3.  
  4. DoCmd.SelectObject acForm, Screen.ActiveForm.Name, False
  5. DoCmd.PrintOut
  6.  
  7. Me.FilterOn = False
Jun 5 '07 #2
Thanks for your reply,

but there are 2 tables employee & appointments for every employee there can be many appointments ( say "n") . So when i print the appointments screen it prints it correctly but prints it a number of times ( "n" times).

This is because setting is to print current selection and all those appointment records are selected at this point of time.

Is there a way to not print current selection of records but to just "print the screen".

Thats whay i think P. Key funda wont apply here as all those appointment belong to that particular employee.

Thanks,
Archana
Jun 5 '07 #3
ADezii
8,834 Expert 8TB
Thanks for your reply,

but there are 2 tables employee & appointments for every employee there can be many appointments ( say "n") . So when i print the appointments screen it prints it correctly but prints it a number of times ( "n" times).

This is because setting is to print current selection and all those appointment records are selected at this point of time.

Is there a way to not print current selection of records but to just "print the screen".

Thats whay i think P. Key funda wont apply here as all those appointment belong to that particular employee.

Thanks,
Archana
The following code will copy the Active Screen to the Clipboard. You can then Paste it into any Application that will support this type of operation. Don't think this really helps - but it is an idea.
Expand|Select|Wrap|Line Numbers
  1. SendKeys "%({PRTSC})", True
Jun 5 '07 #4
jamjar
50
Thanks for your reply,

but there are 2 tables employee & appointments for every employee there can be many appointments ( say "n") .
......
Thats whay i think P. Key funda wont apply here as all those appointment belong to that particular employee.

Thanks,
Archana
I think you could add the second part of the key (Appointment) to the filter. If you use the code ADezii suggested it would become:
Expand|Select|Wrap|Line Numbers
  1. Me.Filter = "[PersonID]=" & Me![txtProductID] & "[AppointmentID]=" & Me![txtApptID]
  2. Me.FilterOn = True   
  3. DoCmd.SelectObject acForm, Screen.ActiveForm.Name, False
  4. DoCmd.PrintOut
  5. Me.FilterOn = False
or you could use filter by form to narrow the records returned to just the one before you print.

James
Jun 6 '07 #5

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

Similar topics

1
by: YERVANT | last post by:
I would like use the Print Screen Button to copy a part of page using ASP. En fact, I use a data access page of a chart (pivot) created by access. And I would like copy only the chart. I think...
0
by: Vicente Nicolau | last post by:
Hello, I'm programming an application and I need to disable the print screen key. How can I do it? Can I use the UIPermissions to disable the print screen key? Thanks
2
by: Tim Marsden | last post by:
Is there a way of turning off or preventing the print screen function while my application is running. (VB.NET). Thanks Tim
3
by: Zlatko Matić | last post by:
Hello. I tried to print the current situation on the form/subform/subform...but it seems that Access prints all the records on all the subforms. I would like to print just the image (something...
0
by: melanieab | last post by:
Hi, I have a tabpage with a print button. This button tries to do a print screen, and it works fine the first time, but if I try to press print again, I get error: An unhandled exception of type...
2
by: chicken butt | last post by:
I have a back office app developed using the 1.1 framework with VB.NET. When we print using the browser, the end result is garbled pretty good. I am wondering if it is possible to create a...
2
by: zalph | last post by:
1- Is it possible to disable the keyboard print screen... 2- ... in javascript? If so, how?
2
by: toronto | last post by:
Seasons Greetings Everyone! I want to use JavaScript's event object to detect whether someone has pressed the 'PrintScreen' key to screenshot, via the Windows Clipboard, and to print website...
8
by: =?Utf-8?B?THVpZ2k=?= | last post by:
Hi all, anyone knows if is it possible to insert (and obviously save) a Windows print screen in a GridView cell? (ASP.NET 2.0). Thanks in advance. -- Luigi
3
by: Joe Duchtel | last post by:
Hello - I would like to create an application that starts up upon login (e.g. Startup folder) and then waits for the Alt+Print Screen button to be pushed. I still want this button to put a...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.