Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumber in textbox via button click

Status
Not open for further replies.

codecomm

Programmer
Feb 14, 2007
121
US
Newbie to InfoPath here!!!!!!

I have an InfoPath form, and when the user clicks a button, we'd like to populate the textbox with a sequential autonumber, and it will be prefixed by a determined string....say "ABC".

So, the first person to click the button will get the textbox populated with the value "ABC-000001", and the second person "ABC-000002", etc.

I don't really know the best way to handle this, but am thinking an Access database is the best.

On the button click event, I could insert a record (so I can now have a new ID) and populate a "holder" field of a datetime stamp, then after the insert statement do a select for the max ID ordered descending limit 1.

What I don't know is how to do:

1. The actual insert into the Access DB

2. How to turn around and do the select / execute scalar for MAX ID DESC limit 1

I have setup the connection to the Access DB in the codebehind for the InfoPath form.

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top