September 2, 200520 yr I have a text field, "ID", that is set to auto-enter serial numbers in the format "pt00001" and increment by 1. It works great when adding new records. When adding new records the field increments by one in the format I specified. ie, pt00002, pt00003, etc. The problem I have is when using the Set Next Serial Value script step on this field. I use it in a script when certain conditions exist. I use a calculation like: ID + 1. So basically I am saying set the counter to the value of the ID field on the current record plus one. The problem is that when I use the script step it returns a straight number without the formatting that I wanted. For example if the ID field on the current record has "pt00001" in it and I run that script step I get "2" instead of "pt00002". Anyone no what can be done?
September 2, 200520 yr Adding only applies to numeric portions of a field. You have to add the text portion and leading zeroes to the calculation. Set Next Serial Value [YourTable::ID; "pt" & Right( "0000" & YourTable::ID + 1; 5 )]
September 2, 200520 yr Or: Set Next Serial Value [ YourTable::ID ; SerialIncrement ( YourTable::ID ; 1 ) ]
September 2, 200520 yr I trust you have typed those asterisks yourself - rather than using language not fit for mixed company!
September 3, 200520 yr :offtopic: Not since when, but until when. According to Wikipedia: Until around the mid-20th century ******* was a more offensive term than it is today,and was frequently represented as "D--n," "D---," or abbreviated to just "D." The use of "*******" in Rhett Butler's parting line to Scarlett O'Hara in the film Gone With the Wind in 1939 captivated moviegoers. "*******" is commonly nowadays known as a very mildly profane word and used while cursing or swearing. However, the Am.Heritage Dictionary lists the word with no marking as profane or even vulgar. And so does the Bible.
September 6, 200520 yr Thanks for the etymology lesson, Comment, but I was referring to the forum software. :wink2:
Create an account or sign in to comment