PrintOut is not available (1 Viewer)

emillerd

New member
Local time
Yesterday, 23:54
Joined
Jun 24, 2019
Messages
10
Good morning!
I programmed an application back in 2004 with Access 2000.
I have not modified it since then.
Everything works fine if we are using the Access 2000 runtime or any full version of Access up to 2016.
When I try and open the application with Access Runtime 2007 or 2013, I get an error when I go to print stating that the PrintOut command is not available at this time.
The code I use to print is:
_________________________________
Private Sub printpotext_Click
On Error GoTo ERR_printpotext_Click

Dim stDocName = "Purchase Order Control"
DoCmd.SelectObject acReport, stDocName, True
DoCmd.PrintOut , , , , 2

Exit_printpotext_Click:
Exit Sub

Err_printpotext_Click
MsgBox Err.Description
Resume Exit_printpotext_Click

End Sub
_______________________________________

Am I coding this incorrectly? As I stated it works fine in the 2000 Runtime or any full version from 2000 up to 2016.

I'd like to use the updated runtime because it puts date pickers next to all of the date fields.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:54
Joined
Oct 29, 2018
Messages
21,447
Hi. Welcome to the forum. I can't say I see anything wrong with it. If you're trying to print two copies of the same report, then a workaround may be is to open/print the report twice. Just a thought...
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:54
Joined
Feb 28, 2001
Messages
27,122
I am curious. Do you actually have that many versions of the Access Runtime on the same machine? Or is there a set of machines, each with one of those versions?

The question also depends on how you are connected to the printer. If it is a network printer (wireless or hard-wire doesn't matter), then the immediacy of the .PrintOut action might be thwarted if there is a problem with the printer at that moment. For the wireless printer case, if the network to the printer is down or the printer is busy and its spooler is full, I could see being disallowed to do print.

I looked at the code. Like theDBguy, I don't see anything obvious, so I am inclined to look at the connection to the printer.
 

emillerd

New member
Local time
Yesterday, 23:54
Joined
Jun 24, 2019
Messages
10
Thank you both for your input:)
We only have 1 runtime installed on the users computer. What has prompted me to pursue this issue is that the user has complained that the date picker (little calendar icon) is no longer next to the date fields.

Access 2000 runtime prints fine but does not have the date pickers. Under 2007 and 2013 runtimes it has the pickers but will not print. We just upgraded her computer. The last time we took the old one in for repair, they put the full version of Access 2007 on it.

Through testing, I have found that the DB prints under full versions 2007 and 2016. I only have 1 copy of 2016 so I can't put that on her machine and we never received the physical media from the repair shop for 2007.
I find it odd that it works under full installs but not with the runtimes.

Oh, I forgot. It is set to print to the host computer's default printer which is set to a network printer. There appear to be no issues with that connection.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:54
Joined
Oct 29, 2018
Messages
21,447
Hi. Like I said, I can't see the problem from here. So, as a workaround, have you tried using two DoCmd.OpenReport lines instead of the DoCmd.SelectObject and DoCmd.PrintOut combo to print the report twice?
 

emillerd

New member
Local time
Yesterday, 23:54
Joined
Jun 24, 2019
Messages
10
I did try and replace them to read as follows:
------------------------------------------------------
Private Sub PrintShopPO_Click()
On Error GoTo Err_PrintShopPO_Click

Dim stDocName As String

stDocName = "Purchase Order Control"
DoCmd.OpenReport stDocName, acNormal
DoCmd.OpenReport stDocName, acNormal

Exit_PrintShopPO_Click:
Exit Sub

Err_PrintShopPO_Click:
MsgBox Err.Description
Resume Exit_PrintShopPO_Click

End Sub
------------------------------------------
Private Sub PrintJobPO_Click()
On Error GoTo Err_PrintJobPO_Click

Dim stDocName As String

stDocName = "Purchase Order Control"
DoCmd.OpenReport stDocName, acNormal
DoCmd.OpenReport stDocName, acNormal
DoCmd.OpenReport stDocName, acNormal

Exit_PrintJobPO_Click:
Exit Sub

Err_PrintJobPO_Click:
MsgBox Err.Description
Resume Exit_PrintJobPO_Click

End Sub
-------------------------------------
The result is that it ask's for the PO number for each copy.

I have been looking through the attic here and found a box with software in it. I'll have to see if Office is in there. If it is, I'll just install do a full install of Access on her machine as long as it's compatible with Office 2016.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:54
Joined
Oct 29, 2018
Messages
21,447
I did try and replace them to read as follows:

-------------------------------------
The result is that it ask's for the PO number for each copy.

I have been looking through the attic here and found a box with software in it. I'll have to see if Office is in there. If it is, I'll just install do a full install of Access on her machine as long as it's compatible with Office 2016.
Hi. If you don't find the right software, try using a form for the parameter, rather than let Access prompt the user for the value. Good luck!
 

emillerd

New member
Local time
Yesterday, 23:54
Joined
Jun 24, 2019
Messages
10
My solution ended up downloading an Office 2007.iso and using my existing ket to install Access 2007 from there. I then went in and hid all of the menus I could just to prevent accidental modifications to my application.
Not exactly what I wanted but it is a workable solution.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:54
Joined
Oct 29, 2018
Messages
21,447
My solution ended up downloading an Office 2007.iso and using my existing ket to install Access 2007 from there. I then went in and hid all of the menus I could just to prevent accidental modifications to my application.
Not exactly what I wanted but it is a workable solution.
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom