?
Solved

Report on mde with runtime keeps setting back to letter size instad of custom size

Posted on 2005-04-28
14
Medium Priority
?
380 Views
Last Modified: 2013-12-05
I developed an application and is being deployed as an mde file running on
the access runtime.  All the workstation where the application is installed
keep the report size exept for one.  In this machine the first time this
report was printed the custom form size was not created.  After it was
created it has never gone back to printing it on that size not matter what I
do.  I have replace the mde file, uninstall and reinstalled the runtime and
the application, but nothing it always goes back to printing in letter size.  
Is there a place where the report size information gets stored where I can
reset it back to the original?

The application runs on Windows XP SP2 and it was developed using Access 2000.

Thank you for your help on this matter.

Fernando
0
Comment
Question by:JFercan
  • 5
  • 4
  • 4
  • +1
14 Comments
 
LVL 39

Expert Comment

by:thenelson
ID: 13888312
If I am understanding you correctly, you have changed the printer settings for your report to print out on some other size paper (legal, envelope, A4, etc.) but on one machine, it changes back to Letter.  If that is correct, these are some of the things to check for:

Is the printer name different on that computer? (http://support.microsoft.com/default.aspx?scid=kb;en-us;209757)
Is the printer port different or is the printer a network printer? (http://support.microsoft.com/default.aspx?scid=kb;en-us;208912)
Is the name autocorrect feature turned on(in options?) (http://support.microsoft.com/default.aspx?scid=kb;en-us;240826)

If those don't work, you can download and take a look at the routine I created to switch printers and change printer settings at: http://www.nosuffering.com/Nelson/.  The file name is: Printer Setup Demo.zip
0
 
LVL 1

Expert Comment

by:jazzmoney
ID: 13888769
Reinstall Printer Drivers!
From the Printer Control Panel, remove the printer.  Then File > Server Properties. Delete the Printer Driver. Then reinstall the printer.
I've seen this happen many times. It sometime happens when you install a particular brand of printer. Like you have an Epson printer installed at one time, but then you attempt to install an hp printer.

You can print to it, but you are unable to set the print properties on that printer.
0
 
LVL 2

Author Comment

by:JFercan
ID: 13889347
thnelson:

The printer name is the same and the port the same as the other machines.  I turned of the name autocorrect feature off and recompiled the mde. None of this have solved my problem.

jazzmoney:

This is what I thought at first and I installed and unisinstalled and copy different version of the dirvers and folled okidatas suggestions to use a different driver but non of it worked, however if I rename the printer the error message box that let's me select a printer show's up.  After that I rename the printer back to the original name, select to print to that specific printer and select my custom size.  At that point the reports prints correctly, but after that it goes back to printing in letter size an not my custom form.

I had another machine that was having the same problem.  This machine is used by another developer so he has the full version of access 2000 and developer tools.  I open the project file in his machine reset the report page settings and re-compiled.  In his machine now the mde works correctly.  This is why I think that the report selection gets saved somewhere in the machine, but I cannot find where.

Thank you for your input.

Fernando
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

by:jazzmoney
ID: 13889471
When you say "report selection gets saved somewhere in the machine" what exactly are you asking?

The custom form is has to be created on each machine. Looking at your original question, you're asking how to reset Page / Printer Properties for individual reports.  The information is stored in the properties of the report.
Several years ago, I tried looking into setting a Report's page properties via code and appeared to be a huge undertaking. One issue was that when you specified the printer, you could cause your machine to have a blue screen (BSOD).  

I wish I could give you a specific answer to resolve your issue, but I'm stumped.
0
 
LVL 39

Expert Comment

by:thenelson
ID: 13889673
What ever the problem this should solve it:

1. Open up the Printing Preferences from Windows (not in Access) and set the settings you want for one setting.
2. In Run type:
    rundll32 printui.dll,PrintUIEntry /Ss /n "the printer name in quotes" /a "the path and name of a file to store the settings in quotes" u
    Example:  rundll32 printui.dll,PrintUIEntry /Ss /n "Okipage 10I" /a "C:\FolderA\OkiA4.ptr" u
    This will create a file with the settings you want.
3. In VBA code before the print command put:
     rundll32 printui.dll,PrintUIEntry /Sr /n "the printer name in quotes" /a "the path and name of a file to store the settings in quotes" u
    Example:  rundll32 printui.dll,PrintUIEntry /Sr /n "Okipage 10I" /a "C:\FolderA\OkiA4.ptr" u

Don't forget the "u" on the end or it will not work for anyone with less than Power User privledges.

This will change the settings for the printer for all applications on the computer so you would also want to save the printer settings to a file (with the /Ss switch) before changing it; then change it back (with the /Sr switch) to the original settings.

The file "Printer Setup Demo.zip" at: http://www.nosuffering.com/Nelson/  has functions and a table that uses this technique.

0
 
LVL 2

Author Comment

by:JFercan
ID: 13889777
jazzmoney:

The report in the full version of access page set up gets set to print to a specific printer and to a custom form.  When the reports gets printed with DoCmd.OpenReport strName, acViewNormal it works fine from my machine and all the other machines in the office that run the mde with the access 2000 runtime, except for the machine that is giving me the problem.  My theory is that the letter size got saved somewhere outside the mde for this application because even after setting the printer and custom form to the same as the other machines it still prints to letter size.  As I said, I have uninstalled and reinstlled both the runtime and the application, and uninstalled and reinstalled printer drivers but it still only prints to letter size instad of my custom form, only on this machine.

thenelson:

I really do not want to change the code because it works fine except for this particular machine.  I rather format the hard drive of the machine and do a fresh install of everything without forgetting to set the custom form before printing this specific report.  However I really would like to find out if the access runtime saves the reports printing settings outside the mde files, because I cannot think of another explanation for this occurrance.

Thank you both for your input.

Fernando
0
 
LVL 39

Expert Comment

by:thenelson
ID: 13890425
One more question: Which computer is the printer connected to?
0
 
LVL 2

Author Comment

by:JFercan
ID: 13894707
Our file server.
0
 
LVL 1

Expert Comment

by:jazzmoney
ID: 13895022
Access saves the print settings within the report inside the .mde.  When you take the db to another machine (as long it has the same custom paper size) it retains the printer name, print margins, and everything else.

I strongly believe that this is a machine issue. Before you go and reformat the HD, I suggest restarting the print spooler service, then removing all print drivers in the Server Properties. Then reinstall the driver for the Okidata printer only.

If that does not work, perhaps submit a question to the hardware / os forum.

I assume that your db will be printing to a custom form that you feed through a dot matrix printer.
0
 
LVL 39

Accepted Solution

by:
thenelson earned 1000 total points
ID: 13895590
I agree with jazzmoney.  It is a machine issue.  Access does not keep a separate copy of the form on each machine.  It does, however, check to see if the printer has changed.  This is because if you specify a specific printer on a form and that printer does not exist on a different machine, it has to do something.  One of the things it does is reset the settings back to default which for most printers is "letter".  You can confirm this by compiling and converting to the mde file on the machine that is causing the problem.  When you do that, you will probably find that problem on all the other machines but not on that one.  If that is the problem, open the properties for the printer and compare everythng to the other machines.  I know the printer name and port name/specs must be identical.
0
 
LVL 1

Assisted Solution

by:jazzmoney
jazzmoney earned 1000 total points
ID: 13895927
Correct, it will reset back to default printer settings, but it will first give you an error letting you know that the printer could not be found. Do you get any errors when you FIRST open or print the report?
0
 
LVL 39

Expert Comment

by:thenelson
ID: 13896501
In my experience, ff the printer name is the same but the port is different, Access will reset to default printer settings without an error message.  So that may give you so direction of where to start looking.
0
 
LVL 2

Author Comment

by:JFercan
ID: 13896707
Well,  I uninstall the printes, remove the drivers, deleted the ports used by this printes (network ports) and then reinstalled only the Okidata printer after re-starting the machine.  I set the printer exactly the same (name, port name, paper settings, etc) to mine.  I printed and it went to letter size anyway.  Then I removed the Access Runtime and installed the full version.  Copied my mdb (which has the correct printer settings for the report) and when I opened the file and went to the page settings I found that it had reverted back to letter.  I set it to the custom form,  made the mde and this time it worked.  I uninstalled the full version and reinstalled the run time, again back to letter.  So I reinstalled the full version again and re-set the report to the custom form and just left the full version installed for now until I can find what the problem is.

I still think that for some reason access stored or is not reading the printer setting correctly on this machine.

Thank you so much for your help I will split the points between you.

Fernando
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

839 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