Button Click Event Wiring - InfoPath Dev
in

InfoPath Dev

Button Click Event Wiring

Last post 09-04-2009 03:15 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-03-2009 08:31 AM

    Button Click Event Wiring

    I am having a wiered problem with my infoPath form. The root of the problem is - When I try to add a new button and wire up the event with the code behind(vb.net), the form is not recognizing that there is a code that needs get run when a button is clicked. Additionally, when Edit Form Code is clicked on button properties, it shows message that "adding button event handler something something.." but nothing happens. So I decided to hand-code the event in my vb.net project (Code below). But apparently it is not recognizing that there is this code.

    <InfoPathEventHandler(MatchPath:="TestButton", EventType:=InfoPathEventType.OnClick)> _
    Public Sub TestButton_OnClick(ByVal e As DocActionEvent)
    thisXDocument.UI.Alert(
    "The SAVE button will be disabled because the form is READ ONLY (form already opened by another user)")
    End Sub

    I am using InfoPath 2007. Please help....

    EDIT: The real problem is the form is not associated with the code anymore even though Tools-> Form Options-> Programming shows a vbproj attached to the InfoPath form. Anybody?? Please.....

  • 09-04-2009 03:15 PM In reply to

    Re: Button Click Event Wiring

    Perhaps make a copy of the actual code file and put it away someplace safe, then in InfoPath, under Tools / Form Options / Programming, click the remove code button. Then, after the code has been removed, try adding code to your button again, see if the event handler is generated in VSTA. If so, your problem is solved, and you have the copy of your code that you can paste into your new code file. If the event handler is not generated, you may need to run a repair on InfoPath...

    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.