printer issues (1 Viewer)

dtdukes86

Member
Local time
Today, 16:15
Joined
Aug 14, 2021
Messages
83
Hi all, so I have a little issue I've been fixing repeatedly, and I can carry on doing it but it's getting annoying.

I have front-end and back-end SQL Lan, setup working fine otherwise.

I noticed when I distribute a new front-end version to the users, I have to reconfigure my report print settings.

For example one of the reports is a till receipt with no margins to allow the 80mm report on the 80mm till roll, but when I copy a new front-end version to my till pc's I need to open the receipt report, change the margins and save and it works fine. the issue doesn't stop there my a4 invoice report is printed by a local a4 lazer printer but for some reason that defaults to manual feed rather than auto-feed. this happened on my delivery note report also.

The issue only happens after a new version is copied and pasted onto the machine and only happens once, as soon as I make the saves it works fine until I make enough front-end changes to re-distribute.

The version of the frond end I work on is located on my desktop and I have checked 1000 times my printer settings are correct before I make the copies to distribute but still the reports go weird.

Any clues or suggestions would be great. obviously, as time goes on there will be fewer updates to the front end but as we are right now we are still "beta testing" and staff are coming to me with new ideas and things they would find useful in the latest version.

N.B The data is live and staff uses the system daily so I have to be cautious when I do back end-wise obviously.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:15
Joined
May 7, 2009
Messages
19,245
your report was setup to Your Printer when you created the report.

maybe automate your db to "distinguish" each user and each user's printer.
save the printer setup to a table (for each user).
on startup of your db, retrieve the printer parameters specific for each users.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:15
Joined
Feb 28, 2001
Messages
27,187
You can get to the printer's properties before you actually print anything as long as you have a defined form, because a .Printer object exists as a property of a form, and the attributes of the printer are visible/changeable.


Your problem, of course, is that with a new FE you have a new copy of the report, and by default that report would normally use the settings on whatever is your default printer, since that was the printer selected when the report was created.

You can find the printer that a user has selected as a default by looking at the .Printers collection of the Application. There is also the issue that with a new FE, if the user has selected other than his/her system's default printer, you would need to know that, so might wish to consider (as suggested earlier by arnelgp) storing the printer name and settings in a table listing each report.


The final "gotcha" is to realize that if a user currently has no printer connected to the computer, this won't work, because what goes on when you set printer settings is that the Access report "driver" and the Windows printer driver interact to see whether the printer CAN be set to the selected settings. As long as you HAVE a printer, settings can usually be asserted. If you have no printer, then the printer's compatibility with the selected settings cannot be verified and you would get some sort of "can't do this now" type of message.
 

dtdukes86

Member
Local time
Today, 16:15
Joined
Aug 14, 2021
Messages
83
your report was setup to Your Printer when you created the report.

maybe automate your db to "distinguish" each user and each user's printer.
save the printer setup to a table (for each user).
on startup of your db, retrieve the printer parameters specific for each users.
hi this is an instresting idea howver the users can move locations also . so even if iset user a's printers if he changes office or desk his physical printers may change. this is something that needs to be tied to the computer location rather than the user ?
 

dtdukes86

Member
Local time
Today, 16:15
Joined
Aug 14, 2021
Messages
83
You can get to the printer's properties before you actually print anything as long as you have a defined form, because a .Printer object exists as a property of a form, and the attributes of the printer are visible/changeable.


Your problem, of course, is that with a new FE you have a new copy of the report, and by default that report would normally use the settings on whatever is your default printer, since that was the printer selected when the report was created.

You can find the printer that a user has selected as a default by looking at the .Printers collection of the Application. There is also the issue that with a new FE, if the user has selected other than his/her system's default printer, you would need to know that, so might wish to consider (as suggested earlier by arnelgp) storing the printer name and settings in a table listing each report.


The final "gotcha" is to realize that if a user currently has no printer connected to the computer, this won't work, because what goes on when you set printer settings is that the Access report "driver" and the Windows printer driver interact to see whether the printer CAN be set to the selected settings. As long as you HAVE a printer, settings can usually be asserted. If you have no printer, then the printer's compatibility with the selected settings cannot be verified and you would get some sort of "can't do this now" type of message.
this looks like it might work using the .Printer above but I'm not sure how to implement it if I'm honest , I'm obviously trying to print a report, are you saying i need to create a hidden form or something before printing ?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:15
Joined
Feb 28, 2001
Messages
27,187
this looks like it might work using the .Printer above but I'm not sure how to implement it if I'm honest , I'm obviously trying to print a report, are you saying i need to create a hidden form or something before printing ?
My bad....

Reports have a .Printer and a collection called the .PrtMip



I grabbed a couple of quick references for Access but got the wrong ones.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:15
Joined
Feb 28, 2001
Messages
27,187
Well, blowing your mind might at least chase away some dust and cobwebs.... 😁
 

C3P420

New member
Local time
Today, 11:15
Joined
Apr 18, 2023
Messages
5
I have to fight with some similar issues, a couple examples being where users want to print something in black & white and sometimes in color, but without having to select that each time and controlling whether the printer prints single or double sided.

I'm assuming when you print a receipt, you're opening some formatted Access report object and sending it directly to the printer. There's an alternate method you might be able to use.

Many times regardless of what you think the settings are, Access will suprise you. I've had reports where every setting we could find was set to print single sided, yet the printer would print double sided because it could. The only solution was working with the Report.Printer object like below.

In the example below, I'm opening a report in Print Preview and Hidden mode. Then, ensuring the printer object of that report is set to print one sided copies in black/white. Then it prints the report out and closes it.

There are quite a few settings you can manipulate (device, margins, spacing, etc.)

Code:
DoCmd.OpenReport strReport, acViewPreview, , "[Invoice Number] = '" & Me.Invoice_Number.Value & "'", acHidden
Reports(strReport).Printer.Duplex = acPRDPSimplex
Reports(strReport).Printer.ColorMode = acPRCMMonochrome
DoCmd.PrintOut
DoCmd.Close acReport, strReport, acSaveNo
 

dtdukes86

Member
Local time
Today, 16:15
Joined
Aug 14, 2021
Messages
83
@The_Doc_Man
hi doc after playing with the bits of code in your replies a few days ago I now find myself with a totally new issue,. for some reason I cannot print anything at all from access.
i can print from other ms products such as word and outlook but not access. windows has many printers installed , I did try changing my default printer from a lan printer to USB printer as I read that might help but in this case it did not, I suspect it something to do with with what I was playing around with the other day regarding printer liabaries or something like that not that I have a clue really . i just need to be able to print again .
is there a way to reset access printer list ?


do I completely change that I cannot print from windows today . ;( will inviesgate now
 
Last edited:

dtdukes86

Member
Local time
Today, 16:15
Joined
Aug 14, 2021
Messages
83
I have to fight with some similar issues, a couple examples being where users want to print something in black & white and sometimes in color, but without having to select that each time and controlling whether the printer prints single or double sided.

I'm assuming when you print a receipt, you're opening some formatted Access report object and sending it directly to the printer. There's an alternate method you might be able to use.

Many times regardless of what you think the settings are, Access will suprise you. I've had reports where every setting we could find was set to print single sided, yet the printer would print double sided because it could. The only solution was working with the Report.Printer object like below.

In the example below, I'm opening a report in Print Preview and Hidden mode. Then, ensuring the printer object of that report is set to print one sided copies in black/white. Then it prints the report out and closes it.

There are quite a few settings you can manipulate (device, margins, spacing, etc.)

Code:
DoCmd.OpenReport strReport, acViewPreview, , "[Invoice Number] = '" & Me.Invoice_Number.Value & "'", acHidden
Reports(strReport).Printer.Duplex = acPRDPSimplex
Reports(strReport).Printer.ColorMode = acPRCMMonochrome
DoCmd.PrintOut
DoCmd.Close acReport, strReport, acSaveNo
i think this is what doc was getting at also. i might have another go at it but for now I've lost all my pritners in access not sure why ><
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:15
Joined
May 7, 2009
Messages
19,245
i think this is what doc was getting at also. i might have another go at it but for now I've lost all my pritners in access not sure why ><
you as the Doc for some "real" code, not just point-to-point.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 10:15
Joined
Feb 28, 2001
Messages
27,187
This "Doc" doesn't always HAVE real code. My Navy experience was that you didn't hardly EVER directly print something. Instead, you saved it as a file so you could Email it as an attachment. Don't ask me why, other than the Navy was remarkably stingy with printer paper. They were trying to go paperless in our office - so I never actually implemented direct-print sequences. I know the general theory but have nothing to actually show.

I once suspected that they wanted to go paperless so that they could use that paper they saved to make more red tape with their office supplies budget, but don't quote me on that.
 

dtdukes86

Member
Local time
Today, 16:15
Joined
Aug 14, 2021
Messages
83
haha well, it took me all day but in the end, i had to go back to good old, format c: and reinstall, was very strange issue that is resolved now following the os reinstall,. every day is a school day lol , thanks all for advise as always.
 

Users who are viewing this thread

Top Bottom