Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Easily find an Access 2003 Paper Size Value for a Dymo Printer eg 20256 Shipping = 143 (on this machine)

Posted on 2007-03-28
6
Medium Priority
?
399 Views
Last Modified: 2013-11-28
I'm using Access 2003. I have different reports printing on different printers. One of those printers is a DYMO 400. I do not want to specify a printer for the report as this MDE will be going to many workstations and the printers could be on differnt ports etc. I have found the solution and now need to "automate it"
I use the follow to print to the printer currently:

set application.printer = application.printers("DYMO LableWriter 400")
stDocNam = "PrintLabel"
docmd.echo off
docmd.openreport stDocName, acViewPreview (yes i know i can ,, hidden)
with reports("PrintLabel).printer
.papersize = 143
.leftmargin = .233 * 1440
.itemsizeheight = 2.2083 x 1440
end with

OK so here is what I need to automate. ... I only found out that the Paper size for the DYMO Printer 400 is 143 because I had to make another report, choose specific printer...(Dymo 400)... select the label size (Shipping 20256)... then open the report, go to Alt-F11, CTRL-G and typed ?reports("printlabel").printer.papersize
This now gives me what THIS machine has for the Dymo 400 20256 Shipping address label .
I want to have some kind of a script that the user can run to automatically show ALL paper sizes (label sizes in this case for Dymo printers) AND THEIR corosponding ACCESS paper size single number... eg 143

This way I can then have a table and allow the user at that workstation to find the shipping lable single number and enter it thus allowing me to use in my code instead of hardcoding 143 which will change depending on each workstation.

help?

Thank-you in advance.
0
Comment
Question by:detroitdr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 39

Expert Comment

by:stevbe
ID: 18812205
this will entail api / registry as Access does not provide a way to iterate through paper sizes built in to it. I don't have the code and you might be better off asking in the VB TA.

Steve
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18812319
I found the base api you could use ... PrtDevMode. I will say it is quite complex but Access Developers Handbook (desktop) noty only details it for you but also wraps it all up into a very user friendly class module.

Steve
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18812356
here are a couple of good links here on EE, the second one has a function someone put together that handles papersize using PrtDevMode

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_20107944.html
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_10218479.html
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:detroitdr
ID: 18812995
I did see the PrtDevMode, but those commands do not work with MDE, only MDB.
I just can not believe that you can not get VB to search some file (Access must setup?) for printer and labels for the number it assigns to each "paper size" that printer supports....

Thank-you for your answers

(I'm new here so I'm not sure if I'm to close this report done or not.... I only see Accept as solution or multiple... and i have no idea what I should do for this board...)

I'll try asking in VB as per your suggestion. thx


0
 
LVL 39

Accepted Solution

by:
stevbe earned 2000 total points
ID: 18814861
VB has a different printer object that you can not use in Access but it basically exposes the same properties as PrtDevMode and when they move beyond the built-in capabilities they use PrtDevMode.

Here are the guidlines for how to close questions.
http://www.experts-exchange.com/help.jsp#hs5
0
 

Author Comment

by:detroitdr
ID: 18815033
I've asked this question in another area.

To all who stumble across this issue.... It currently appears that:

-you have a Report in Access
-you are making a MDE
-you are not selecting a specific printer (for obvious reasons regarding deployment)
-you are using non standard paper (Dymo labels are SMALL)
-you can not automatically query Access to find out the paper size Number assigned
   to an installed printer for that printers paper. (eg Dymo Shipping label paper 30256)
-you CAN do it yourself manually.. but that defeats the purpose.

You can do it manually by using the MDB, copy the report, select the specific printer in page setup, select the paper size (what label you want...30256 Shipping when using Dymo printer), then open the report, press Alt-F11, Ctrl-G, and type ?reports("your report name").printer.papersize
this will tell you for this computer (with its own installed printers) what number Access assigned to that "paper size" (label)

That is what I want to do automatically as the order of installed printers and what printers installed will change that value from system to system..... and in my opinion.. if you can't select non-standard paper sizes (2.23" x 4" Dymo shipping labels) then giving us commands to change margins,row spacing,item size height and width,orientation and itemlayout is useless. (Again because it appears you can't do the manual query above to find out the unique number on a workstation for the lable as the pre-defined papersizes don't cover Custom.....

Should I close this or does anyone know if you can do that manual query automatically?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

610 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