Defining a simple variable? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Defining a simple variable?

Last post 08-02-2012 01:26 AM by maillme. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-31-2012 02:28 AM

    Defining a simple variable?

    Hi there, I've did a search for this, and my very limited coding knowledge / experience has only made it rather confusing. what is the easiest way to define a variable within a form? So far I have only managed to do this via a secondary data source........ thanks, Neil
    Brand new to InfoPath. Have version 2007.
  • 07-31-2012 07:47 AM In reply to

    Re: Defining a simple variable?

    So - what do you mean here? Are you writing custom code for your form and you need a variable in the code? Or do you need a form field that you can store data in? A little more information would help....

    Hilary Stoupa

  • 08-01-2012 01:31 AM In reply to

    Re: Defining a simple variable?

    Hi Hilary, thanks for your reply and apologies for my unclear question. I guess I'm just wondering how to declare a simple variable that I can use in my form. E.g. in MS Access, I would do something l;ike var MyVar = "Neil" But I don't know how to define such a variable in InfoPath - although i think, from experimenting, I just need to create a text field? thanks, Neil
    Brand new to InfoPath. Have version 2007.
  • 08-01-2012 08:30 AM In reply to

    Re: Defining a simple variable?

    Yes, just create a text field, give it a meaningful name, and, if you wish, set a default value for it. You can have fields in your data source that don't have controls on the form - sometimes we need fields for things that the user doesn't need to see or change (a status field that gets set via rules would be an example of this). Often, you can use a secondary data source (XML file included with the form in the resource files) for logic or view information that doesn't need to be persisted - say you have a section you want to be able to show or hide via a button click, you might have a field in a secondary data source named "show" and base your conditional formatting around its value.

    Hilary Stoupa

  • 08-02-2012 01:26 AM In reply to

    Re: Defining a simple variable?

    Thank you Hilary.
    Brand new to InfoPath. Have version 2007.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.