'Print Out' problem from .mde (1 Viewer)

loki

Registered User.
Local time
Today, 02:19
Joined
May 4, 2001
Messages
58
Here is my code:

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String
Dim MyForm As Form

stDocName = Me.Name
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub


This is a Print button on a form. This works fine in my Access2000 mdb but as soon as I make a mde it no longer works and gives me the error "The command or action 'Print Out' isn't available now." Does anyone know how I can get this button to work from the mde. I can go to the top and select File/Print and it works, but I also need this button to work.
 

loki

Registered User.
Local time
Today, 02:19
Joined
May 4, 2001
Messages
58
I'm not suppose to change the design of the form, I just have to get the print button to work.
 
R

Rich

Guest
Not sure who's given you this restriction, but you should point out to them that forms are not designed with printing in mind, that's what reports are for, however the command for the form is just DoCmd.PrintOut
 

Users who are viewing this thread

Top Bottom