Autonumbering in Infopath - InfoPath Dev
in

InfoPath Dev

Autonumbering in Infopath

Last post 04-19-2006 01:44 PM by rjaynes. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-16-2006 01:02 PM

    Autonumbering in Infopath

    Hi! I am trying to create an automatic number field that starts at 531. It's for a ticket support form. I need to program a text box field to increment everytime a new form is created, otherwise if a ticket is just opened not to do anything. I am using VBScript. The form is connected to an Access Database. Thanks,


    Lisa Spencer
    Programmer/Office Specialist
  • 01-17-2006 06:40 PM In reply to

    Re: Autonumbering in Infopath

    Please see this thread:http://infopathdev.com/forums/topic.asp?TOPIC_ID=1558

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-19-2006 01:44 PM In reply to

    • rjaynes
    • Not Ranked
    • Joined on 04-19-2006
    • USA
    • Posts 2

    Re: Autonumbering in Infopath

    I'm just a beginner with InfoPath, but here's what I did to get my trouble ticket number field to increment:
    My main data table in Access has a primary key field (my ticket ID number).
    I have a textbox bound to this field in my InfoPath form. (With my main data table set up as the primary data source.)
    I have a secondary data source set to query data that is also linked to this same table, and I am pulling only the ticket ID number from it.
    In the textbox properties, I have a formula set up as follows:
    max(@Ticket) + 1
    The "@Ticket" is the ticket ID field from the secondary data source.
    I have left the "Update this value when the result of the formular is recalculated" checkbox empty.
    Now, when I go to preview or actually run the ticket, my Ticket # field displays a new ticket number, because it is adding 1 to the highest number is found to already be in the table.
    The ONLY catch I've run into is that if there is nothing already in the database, I get an invalid data error because there is not even a zero in that field technically, so InfoPath doesn't know how to increment nothing by 1. To get around this I have added the first ticket (as a test ticket) and that solved my problem temporarily, but I haven't figured out how get around that the "right way". I would assume if you wanted to start with a specific number you could just directly add one into the database, unless it already existed then it shouldn't be a problem. Hope I have helped and have not been totally confusing. If anybody else knows of any problems with my setup please let me know because I am currently in the testing portion of my design. Thanks a bunch!
    Ryan

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