I'm building a relatively simple form that a customer will use for sales reports. This form is hosted using Forms Services in MOSS - each salesman (about 50-100 persons) will have his own site with a form library. Each library uses a centrally managed Site Content Type (with fields published as columns) and each site is created from a template.
I have a field called 'Report Number'- in this field I want to generate, on opening the form, a unique ID number based on the user ID (windows login account name) and a consecutive number based on the forms existing in the library - eg: 'jonhil-12345'. The user ID I have already retrieved to populate another field so I can reuse that or use the defualt 'userName()' function.
The question is - how do I create the automatic number sequence - to start at 1 and increment within the existing library ??
(Note: the specific library cannot be referenced since this form template is a centrally managed Site Content Type and all the libraries will be set to use this - no forms are published directly to a library)