Macro for Page setup ?

bltomov

New member
Local time
Yesterday, 20:53
Joined
May 29, 2010
Messages
2
Hi,

i have created a database, with some queries. All works fine. But, when i would to print the result of the query, or the database, every time, i must adjust change the page setup. And this is horrible. My question is, is it possible to create a macro for this ?
I have found, that i can do this with report, but the problem, is to design the report. With the print option for a table, works, fine but the page setup is horrible. :mad:
I thing, the print option, create internally a report, and it will be printed. When this true is, how can i use this report, and change only the page setup?

Every idea, to solve the problem?

Regards,
Boian!
 
I rarely use Reports but I think most of what applies to Forms will apply to Reports.

Check Setvalue macro action and the various properties of Forms/Reports.

For example, labels and textboxes have a "Visible" property and so

[Forms]![MyForm]![MyLabel].[Visible]
Yes

If it was No then you would not see it.

You will probably find that the various things with "page setup" are properties that can be selected by Setvalue macro or VBA.

Basically, whatever you can do with a Form in Design view (and I assume a Report is the same) can be done with a macro SetValue action or a This = That in VBA

When it comes to Tables and Queries there is not a lot that you can automate as Access is all about Forms and Reports that are based on the tables or queries.

So check (Google for starters) on the various properties for Forms/Reports and see if any relate to page setup. If they do, then they can be set by either macro or VBA.
 
Yes, that's right. I can use, a report, or a form. But, when i want to print a simple table, with all data of the table, i must create a big report, with hundred features that i don't need. The print option, makes exactly this, but i have the problem with the page setup. Every time, i must change the page setup.
Exactly, this was my question, if is it possible to do this, with a simple macro, and not using reports or forms.
The problem, is that is to difficult, to create a good table, with all data, using a form, or report. But, i thing it is not possible, so i thing to switch, to using openoffice. It's better than Microsoft office, it's free...
And the documentation about macros for MSOffice, is horrible, there is simple no documentation.

Thank you in advance!

Regards
Boian
 
You can make a form or report as simple as you like. You can also show a form as data sheet view. In data sheet view the form looks exactly like a table.

But as to a macro as I said it will be SetValue action to the form property and VBA will look like

Forms!PrintAndClose!Label249.Visible = False The Visble in both VBA and SetValue macro is replaced by the form property.
 
Normally you would have a report run from a query that just selected the fields you want and then make a report from the query.

Once you have the report set how you want and saved it should stay that way.

Also, when in the report, design view, you can select File, Page Setup from your normal menu bar on the top of your screen. This allows you to set page (a4, a5, letter etc), layout (landscape, portrait), Margins and a few other limited options.

We use Reports a lot - mostly in Preview but also to print as a.pdf and email or fax and have never had a problem with the page having to be reset.

If we install a new pc we sometimes have the A4/Letter issue but this is easily changed and saved and fixed.

Watch your terms used. You don't create a table from forms you create a form from table.

When you create your Report. do you save it ?

If your database is small and doesn't have sensitive data and can be compacted and repaired and converted to 2000 or earlier, attach it and I will have a quick look at your report.
 

Users who are viewing this thread

Back
Top Bottom