Closing an InfoPath Form after Printing is complete - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Closing an InfoPath Form after Printing is complete

Last post 11-14-2008 08:55 PM by Anuma. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-11-2008 08:14 AM

    Closing an InfoPath Form after Printing is complete

     I have a user that wants the form he is filling in to automatically print and close the form when he clicks on a button.

    I've managed to get the form to print when the button is closed but when I then add the Close element to the code the form closes before it has a chance to print.

    The example code that I am playing with is as follows:

    Public Sub CTRL4_5_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
               
                Dim field2 As XPathNavigator = e.Source.SelectSingleNode("my:field2", NamespaceManager)
                If (field2.Value) = 2 Then

                    Me.Print()
                End If

                Me.Close()

     Can anyone help me?

  • 11-11-2008 10:28 PM In reply to

    Re: Closing an InfoPath Form after Printing is complete

    Try adding the close as an action.

    Code runs before rules if I remember correct.

    Otherwise you might need some delay action in your code to allow printing to complete before the close.

  • 11-14-2008 01:29 AM In reply to

    Re: Closing an InfoPath Form after Printing is complete

     Thanks for the response. Being a very new person to Coding and InfoPath, can you explain what you mean by 'Adding the close as an action'?

     

    Regards,

     

    Mike

  • 11-14-2008 06:21 AM In reply to

    Re: Closing an InfoPath Form after Printing is complete

    Sure Mike.

    If you open properties of a button and go to rules.

    Create a new rule.

    Go to actions and one of your options in the drop down is to close the form.

  • 11-14-2008 08:55 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Closing an InfoPath Form after Printing is complete

    Hi,

     

    Can you follow the below steps to close the form on button click.

    1. Double click on the button to open properties.
    2. Click on the Rules.
    3. Click on “Add” and click on “Add Action” button.
    4. Select “Close the form” from action dropdown.
      

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.