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

How to print screen in Access

P: 3
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
Share this Question
Share on Google+
4 Replies


ADezii
Expert 5K+
P: 8,638
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

P: 3
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
Expert 5K+
P: 8,638
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
P: 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

Post your reply

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