Programming Question - InfoPath to Access Document Number Creation - InfoPath Dev
in

InfoPath Dev

Programming Question - InfoPath to Access Document Number Creation

Last post 12-25-2013 04:31 PM by donstephen. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-19-2013 09:34 AM

    Programming Question - InfoPath to Access Document Number Creation

    I have what might be an easy question or might be something more difficult, but I am hoping someone can shove me in the right direction. I have been using a pdf form that I created in Adobe LiveCycle a few years back. I am not wanting to database the form so am switching to InfoPath which I have never used before.

    My form is basically a purchase request. It will have a repeating table at the top of the form which contains Item Name, Quantiy, Price, and total Price, with a Total of all items field in the footer.

    Under that I have approval places for digital signatures of people in the organization.

    I have the repeating table being sent to an access database and that works out correctly, but how can I basically have it automatically create a document number based on DTG and have it auto fill a field in access along with each item on the current document?

  • 12-19-2013 07:39 PM In reply to

    Re: Programming Question - InfoPath to Access Document Number Creation

    Hi cartotech81,

    To create an auto-generating unique ID, you may use a hidden field with a default value formula concatenated with the formula: translate(now(), "-:", "")

    This formula will generate something like this 20131220T110554. The first part before "T" represents the date and after "T" is the current time.

    To add more uniqueness, you may opt to concatenate the current user or a certain field from your form which best represents the whole document. 

    Please check the rules added to the form I am attaching. By the way, the buttons will generate a unique ID everytime you click it, so you may want to add a condition to only run the rule if the unique ID field is blank, this will enable you to update the document without generating a new ID. Hope this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 12-23-2013 09:10 AM In reply to

    Re: Programming Question - InfoPath to Access Document Number Creation

    Thanks for the formula. That works great. I guess my next question would be how do I set a rule to run on form load?

     I have uploaded my form for thoughts. It really does not do any good without the database, but I can only seem to upload one document.

  • 12-23-2013 09:17 AM In reply to

    Re: Programming Question - InfoPath to Access Document Number Creation

    Nevermind. Figured it out. Tools -->Form Options-->Open or Save-->Rules.
  • 12-25-2013 04:31 PM In reply to

    Re: Programming Question - InfoPath to Access Document Number Creation

    Yes, that should work. Remember to use a condtition that the unique ID should only generate if the unique ID field is blank to prevent creating new when re-submitting old forms.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.