473,789 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating A Macro to Format an Access Report Margins

4 New Member
Hello,

I have been having a problem with my database lately. Everything seems to be working well accept the reports. Everytime I open the report I have to reformat the report margins to get everything to fit on one page. I was wondering first if it is even possible to create an access macro or a combination of a macro and a module to run a format on the report when on the time the report opens so that I can view everything on one page. I want to set all of the page margins to .5" all around. Please let me know if you can help me. Thanks.
Aug 31 '07 #1
9 4889
missinglinq
3,532 Recognized Expert Specialist
Don't need any code! In your menu goto
Tools - Options - General and set Print Margins to whatever you want!

Welcome to TheScripts!

Linq ;0)>
Aug 31 '07 #2
Martian7
4 New Member
Don't need any code! In your menu goto
Tools - Options - General and set Print Margins to whatever you want!

Welcome to TheScripts!

Linq ;0)>

I have already tried this, but Each time I exit the Program, I have to reset the parameters.. That is why I thought may be some kind of a macro so that on entry of the report It would automatically set the margins for me... Please let me know if this makes sense. Thanks.
Aug 31 '07 #3
dima69
181 Recognized Expert New Member
I have already tried this, but Each time I exit the Program, I have to reset the parameters.. That is why I thought may be some kind of a macro so that on entry of the report It would automatically set the margins for me... Please let me know if this makes sense. Thanks.
Report margins have a nasty habit to get reset to defaults when the original definitions are incompatible with the default printer page definitions. There is no simple way to set report margins by VB code, and I am afraid this will not help in your case. I would advise you to just find the optimal margins the printer can accept.
Aug 31 '07 #4
missinglinq
3,532 Recognized Expert Specialist
I think dima69 is exactly right. If you attempt to set the margins to something your default printer won't accept they do, I think, revert to Access' defaults. Access can't force a printer to do something it's not designed to do. About 99.9% of all Access/Printer problems are really printer problems. You might go to the site for the printer's manufacturer and see if they have updated drivers available for your printer. This will often cure this kind of problem.

Linq ;0)>
Aug 31 '07 #5
Martian7
4 New Member
I am just learning about Macros.. I thought the idea of a macro was to take certain actions and automate them. All I want to do is when someone looks at the set of reports they don't have the reports shoot out on two pages instead of one. I know this is possible in Word or Excel to create a macro to run in which you just run the macro and it sets your viewing screen to those certain margins in order to view everything on one page. Maybe I am explaining this wrong...I know when you go to the Page set up in Access it only has the basic margins of Top, Bottom, and Side margins, which is different than that of Word. It just seems like there should be a way to setup a macro that would open the "file" tab on the tool bar and open the "page setup" option and then somesort of a command to automate setting the margins to certain parameters. Am I thinking of something that is "IMPOSSIBLE " for Access? Or has it just not been discovered yet? Please let me know if this sounds "Logical" Thanks for all of your advice... I know I may be talking the issue blue in the face, but it just seems to be logically possible.
Sep 1 '07 #6
dima69
181 Recognized Expert New Member
I am just learning about Macros.. I thought the idea of a macro was to take certain actions and automate them. All I want to do is when someone looks at the set of reports they don't have the reports shoot out on two pages instead of one. I know this is possible in Word or Excel to create a macro to run in which you just run the macro and it sets your viewing screen to those certain margins in order to view everything on one page. Maybe I am explaining this wrong...I know when you go to the Page set up in Access it only has the basic margins of Top, Bottom, and Side margins, which is different than that of Word. It just seems like there should be a way to setup a macro that would open the "file" tab on the tool bar and open the "page setup" option and then somesort of a command to automate setting the margins to certain parameters. Am I thinking of something that is "IMPOSSIBLE " for Access? Or has it just not been discovered yet? Please let me know if this sounds "Logical" Thanks for all of your advice... I know I may be talking the issue blue in the face, but it just seems to be logically possible.
In Access, like in Word, you design the report to the specific, fixed page size (unless you create a dynamic report, which is the whole different thing). This is not like in Excel, where you can just fit everithing to one page. So I don't see a point in runing the script to reset report margins dynamically, while you can do the same thing in design view.
Sep 1 '07 #7
NCRStinks
45 New Member
Not sure there's any need for a macro for this one.

In Access 2003, if you go Tools --> Options you can set the report margins and this is saved for the whole database.

I had the same problem where I had to re-set the margins for the report every time i reopened the database.

Hope that helps!

Dan
Sep 1 '07 #8
Martian7
4 New Member
Okay Guys,

Dan said that he had experienced the same problem with having issues opening the reports and his margins having changed once he closed and reopened access. So let me get this straight say I have certain reports that have to be at a margin of 1.25" all around, some that would fit all on one page if I had a .5" margin all around, and then others that needed specific margins of 1.5 margins all around to look right on "One" page. You all have been talking about the default margins in Access. My question is though... can I set different defaults based on the particular Access File I am working with, or do I just have the one "Default" Setting and have to change the margins based on each individual access File when I go to view the reports. I hope this makes sense. It is just confusing when I open different reports and then go back to my certain set of reports that have to abide by the .5" margin. When I go back to that set of reports the margins seemed to have changed them selves. Maybe I just didn't save each one in the design view to have that certain Page Setup. I guess what I am wondering is Can I set up my reports so that each time I or anyone else opens them they see what I want them to see all on "ONE" Page? There I did it, I think I have finally explained what I really am trying to do.. Please let me know if Ya'll can help me.. THANX/
Sep 4 '07 #9
barry07
47 New Member
You can set different margins for each report, and provided they are not outside the printer capability there should be no problem.

When you have the report open in Design View select File>Page Setup.
Set your margins and save the report. (Note you must EXPLICITLY save the report. If you just close it your settings may not be saved.)

If you know what printer your end-user is using it's worth installing that temporarily as your default printer and looking at your report in Print Preview. The printer doesn't have to be physically present for that to work.
Sep 6 '07 #10

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

Similar topics

1
2235
by: Maurice Mertens | last post by:
Hello, I'm trying to print a report to the printer but somehow it doesn't take the margins I set. I want the report to have a margin of 0.7 cm (397 twips), so in code I use the following: dim rpt as New rptOverview
1
5833
by: P | last post by:
Hi, Access 2002. I am trying to use the PrintOut function to print the current record of the current open form in landscape format to the default Windows printer. Any suggestion on how to set the printout to landscape mode? Thank you. P
4
5063
by: Bob | last post by:
Hi Everybody I have an Access 2000 database full of names and address, the usual thing. I am able to print out an A4 (UK paper size) letter that lines up with a window envelope and shows the address just great. Keeps the mailman happy. However The problem is that there are so many different envelope
1
2917
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access 2000. The access file is in access 2000 format. I have a form that will hold the relevent parameters for the query/report that reports the statistics for all job records that match a certain criteria. These are: - A Customer Name.
3
1818
by: New Guy | last post by:
Is it possible to use two different tables with the Report Design Wizard? My report requires data from two different tables and I can't figure out how to get the wizard to accept the second one. Also, my report uses a bunch of fields which I then rearrange so that they all fit on one page. However, Access thinks that the report is still three pages wide and includes two blank pages where the fields were when I added them to the report....
7
21747
by: steve | last post by:
Hi All I have created rdlc files and when I load them into Report Viewer at run time they appear OK If I click on 'Print layout' button on Report Viewer the view again appears acceptable If I click on 'Page setup' button the margins left & right are not what I set on the rdlc file at design time (1.5cm) they are 5.9mm
2
17724
by: Senthil | last post by:
Hi All I need to create an Excel report and create a command button and have to run a macro on the click event that will print all the pages in the Excel workbook. I am able to create the report from the database but I am not sure how do I put a command button and associate a macro with that using C#. Can anyone help me?? Thanks in advance. Senthil
0
1220
by: vinamb2006 | last post by:
yes,Iam using button onclick event. the code is as under 'PrintReport() prtdoc.PrinterSettings.PrinterName = comboInstalledPrinters.SelectedItem.Text Dim strDefaultPrinter As String = prtdoc.PrinterSettings.PrinterName 'Dim rap As New CrystalDecisions.CrystalReports.Engine.ReportDocument() 'report1.Load("c:\inetpub\wwwroot\ticket\printrpt.rpt") Dim margins As PageMargins
0
1336
by: ARC | last post by:
Hello all, I have a few custom reports I've created for end-users, and it appears that, when I distribute the runtime .accde, access is resetting the margins. Does anyone know for sure if access 2007 does this? I know you can set the paper size, and even margins with the report object, but I have found that using this code ONLY works if you first preview the report. For whatever reason, if you send the report straight to the printer...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.