Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PRINT SCREEN OF AN INPUT FORM 1

Status
Not open for further replies.

PPJOSEPH

IS-IT--Management
Apr 2, 2003
82
0
0
US
Hi,
My database has an Inactive Shut Down form that pops up if there is no activity for 30 minutes and closes the application.

I'm trying to do a print screen of an input form. The form as a vb YesNo button to print. When I click Yes the first time it automatically prints the Inactive Shut Down form and if I click the second time it will print the correct input form.

Is there a way not to print the Inactive Shut Down form at any time?

Any help is greatly appreciated.

Thanks
Paul
 
Can you show us the code behind the print button?

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Zameer:
Here is the code:
Private Sub cmdPrintForm_Click()
On Error Resume Next
If MsgBox("Do you wish to print this form?", vbYesNo) = vbYes Then

DoCmd.PrintOut

End If
End Sub

However, another form (frmInactiveShutDown) is printed when Yes button is clicked. The form that needs to be printed is frmOpenAssignment.

Thank you so much.
Paul
 
why not install an if statement that says if the active form is the inactive shut down form then to exit the macro

ck1999
 
Use the Command Wizard to create a print button on your form And add your If clause to that. Your code will look like..
Code:
Private Sub cmdPrintForm_Click()
    On Error GoTo Err_cmdPrintForm_Click

    If MsgBox("Do you wish to print this form?", vbYesNo) = vbYes Then
        Dim stDocName As String
        Dim MyForm As Form

        stDocName = "Form33"
        Set MyForm = Screen.ActiveForm
        DoCmd.SelectObject acForm, stDocName, True
        DoCmd.PrintOut
        DoCmd.SelectObject acForm, MyForm.Name, False
    End If
Exit_cmdPrintForm_Click:
    Exit Sub

Err_cmdPrintForm_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrintForm_Click

End Sub

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Zameer to the rescue again!!!

Thank you so much Zameer. It worked out great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top