Solved

How to view and alter an embededed macro

Posted on 2009-05-12
4
323 Views
Last Modified: 2013-11-28
Hi
i have a button on a form that prints and shows a report.
This was set up with the wizard.
I would like to alter the code to do the following.
1.Not show the form to the user.
2.Print two copies
3.Provide a message to the user that their reports have been sent to the printer.
I understand that i may be able to do some of this with the Docmd object but can not find the code sheet.
I can find the embeded macro that produces the report but not the code.
access 2007
Puescode
Open frmLetter not visable
print frmLetter copies:2
close frmLetter
Msgbox "Your Reports have been sent to the default Printer"

Open in new window

0
Comment
Question by:petePrinter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:coffeeshop
ID: 24363179
"Not show the form to the user" >> do you mean the user shouldn't see the report?

I assume your code shown is not the macro-code? What you want to do normally can be done with DoCmd.OpenReport. Does the following code works for you:
DoCmd.OpenReport "YourReport", acViewNormal
DoCmd.OpenReport "YourReport", acViewNormal
MsgBox "Your Reports have been sent to the default Printer"

Open in new window

0
 

Author Comment

by:petePrinter
ID: 24364190
coffeeshop
Thanks
i should have said report not form sorry.
Your code does not open the report but sends it to the printer.
I think the form open fires a macro when donefrom the form and runs the embedded macro.
I will latter make a clean form and try the above
i can directly open the form.

Were is the macro code stored please?
Regards
Pete
0
 
LVL 7

Accepted Solution

by:
coffeeshop earned 500 total points
ID: 24365078
Switch to the design mode of the form and open the properties, where you can change different form settings. Scroll down to "OnFormOpen". Here you see [Event Procedure] or [Macro], depending what executed if the event fires (if this is empty, there is no code behind). With a click to ... at the end of the line the macro or vba-editor opens for edit.

"Your code does not open the report but sends it to the printer." Yes - I wasn't sure if this is what you need - if not, please give me more information about what to do, I will  try to help you.
0
 

Author Closing Comment

by:petePrinter
ID: 31580441
coffeeshop
Thank you its fine
Regards
Pete
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question