> The MS example shows long explanations but I couldn't find the full code
> anywhere. Looks as if this is no longer on the web. Do you know if some
> of the MVP's has a copy of it ?
I don't know about full code, I just pointed out some print-dev exmaples.
There is some example code in the above links...one of them leads to:
http://www.mcwtech.com/downloads.aspx
In the above, there is some sampel code that uses printDev.
As I mentned, I advoiced print-dev since I think it is a lot of work.
>
> What I see is: when I'm copying the mdb from one machine to another and
> want to correct the printers to the printernames as they are shown on that
> machine, then I open a report in designmode.
As I said, in ALL CASES you do NOT want to set a default printer in the
reprot..
> If I do and the default on that machine is maybe the tractor then all A4
> settings will be lost it the default is the A4 all the tracktor
> printersettings are lost.
Are they lost? I did not think so. I was suggesting to simply layout the
reprot, and size it untill it works ok.
(this may not work, but it is what I would try).
> You simply need to layout that repot for a dot
>> matrix printers.
>
> The layout is done for such a printer.
Yes, but you still want to have the reprot set as a default printer..and not
a particlar one. I am note sure if I was clear, but my suggestion in all
cases is to NEVER set a speiciv printer in the reprots (page setup)
seetings. However, if thsoe users really do have differnt
dot maxtrix printers, and your default layout does NOT work for each of
those different dot matrix printers, then you will have to resort to using
the print-dev to set this up (or, specive printers and reprots as you have
now).
> But setting all printers to be the defaultprinter causes two problems. The
> setup for matrix reports is : Paperfeed tractor, size 210x305 mm some
> documents in landscape orientation, most are in norml orientation.
Well, the page setup does remember portrant/landsacpe, and the margin
sizes. (if these settngs are being lost, then
perhaps you are expaice ht4e common bug outlined here).
http://support.microsoft.com/default...b;en-us;240826
> Do you think if I'm setting the defaultprinter of my machine to the
> tractor and doing all other settings for every formular
I not tried the above, but I was suggesting to NEVER set an actua. printer
with a reprot.
When I say defalt..I mena a default printer (I personaly use a pdf priinter
as a default).
> Is all my trouble because all my reports are set to 'specific printer' and
> this specific printer doesn't exist when I'm copying mdb to another
> machine
Yes...that is much of your problem....is due to the above..
I mean, for some of the custom invoice printing sutff, I have a user defined
top margin setting. They can "tweak" this setting if they
purchase a differnt printer. I also experiance roller wear and tear..and
that seems to throw things out over time also. As a result, I do
have a form that lets users "setup" the top marking of the report. So, if
there printer wears, or they change the model, then they can change the top
margin to re-aline the form that they are printing on to. The code in the
reports on-open event to do this is
currTop = Nz(DLookup("topMargin", "tblTopMargin", "reportname = '" &
Me.Name & "'"), 0)
If currTop > 0 Then
Me.ReportHeader.Height = currTop * 1440
End If
In the above, I have a table called "tblTopMargin". For each reprot that
needs this setting, I make a entry into the talbe, and then
place the above code into the reprost on-open event. (notice how the above
code can be pasted into ANY repot...no hard coded names).
By chaning the height of the reprots headder...it pushes down all of the
"reprot" that
is to be printed to the printer. (I thus desing my reprots to ALWASY be a
bit high on the page..and then MOVE then down using the above code).
This way, I don't have to bother with complex print-dev code, and the top
alimgnet is saved in a table for me.
> If it works like that please tell me then I would readjust my settings all
> to defaultprinter and doing my code and it should work,even in am MDE.
You will have to try, but, my rule as a developer is that I NEVER set (use)
the report setting that allows you to specify a particular printer, I
ALWAYS use the default printer. (as mentioned, due to your dot matrix,
setting the reports length likely will be a issue that you have to deal
with..so, my approach might not work).
As I said, you can go hog wild with print-dev, but it is a lot of work. The
above example has only 4 lines of code..and allows me to set a value to
"push" down the report a bit for alignment purposes when a different printer
is used.
All of my advice can simply be summed up as
If you can easily avoid print-dev..then do so!! - you might not in your
case, and the top margin, and perhaps a bottom margin setting as just might
do the trick for you (and, the above works as a mde, and even with the
access runtime system)..
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)
http://www.members.shaw.ca/AlbertKallal