Crash course in InfoPath coding using VBScript - InfoPath Dev
in

InfoPath Dev

Crash course in InfoPath coding using VBScript

Last post 07-31-2006 12:21 PM by Greg Collins. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-29-2006 06:52 AM

    • ciredon
    • Not Ranked
    • Joined on 07-18-2006
    • Philippines
    • Posts 9

    Crash course in InfoPath coding using VBScript

    To Anyone that could help.

    I'm new to infopath. Can anyone give me a sample code for me to get the idea on how to perform codes in InfoPath using VBScript.

    What I wanted to do was: I input data into a textbox (Employee Number), then when control is lost (LostFocus())from the textbox it will search a secondary database (Employee Information). When a record in the database matches it will display the corresponding employee information like department, telephone number, last name & first name into corresponding read-only controls in the form. Afterwhich I can submit the final content of the form into the Main database.

    Q1: Is this logic possible to be implemented?
    Q2: Is is true to assume that the controls in the form should be binded to fields in the Main database yet data displayed in these controls comes from a secondary database or from a variable used in coding?

    Thank you in advance.
  • 07-29-2006 09:34 AM In reply to

    Re: Crash course in InfoPath coding using VBScript

    Hello Eric and welcome to the forums!

    You should be able to accomlish this without writing any code. I have written a HowTo on doing this with a Drop-Down list box, but you should be able to follow it pretty closely and apply the same logic to a text box. It would probably be even easier.

    After you have the fields populating like you want to, you can add a button to submit the query to your DB.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-31-2006 12:21 PM In reply to

    Re: Crash course in InfoPath coding using VBScript

    If you do want to do this in code, the "lost focus" you are talking about is really the OnAfterChange event. Do a little research on this event and how to use it.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.