473,421 Members | 1,579 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,421 software developers and data experts.

Creating A Macro to Format an Access Report Margins

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 4873
missinglinq
3,532 Expert 2GB
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
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 Expert 100+
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 Expert 2GB
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
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 Expert 100+
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
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
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
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
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: ...
1
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...
4
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...
1
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...
3
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. ...
7
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 ...
2
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...
0
by: vinamb2006 | last post by:
yes,Iam using button onclick event. the code is as under 'PrintReport() prtdoc.PrinterSettings.PrinterName = comboInstalledPrinters.SelectedItem.Text Dim...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.