Jump to content

How to increment a text field?


This topic is 6099 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have what would be classified as a "text serial number" that I need to increment by 1 upon certain user actions. The field needs to display with leading zeroes. For example: "0001002" would increment to "0001003". Can this be done without using a custom "pad text" function?

Link to comment
Share on other sites

K1200:

The trick is to make it a Text field, not a Number field. This will keep the leading zeros in place.

-Stanley

Link to comment
Share on other sites

Thanks for the response.

These fields are not actual serial numbers, so I can't use the normal auto-increment method that FileMaker provides in the field definition. The numbers need to be incremented after the record is created (in response to user actions), so what I'm needing is a "text math" method that can accommodate the leading zeros.

Stanley: the field is already text. How can it be incremented?

Link to comment
Share on other sites

Amazingly (to me), it DOES work! -- but I can't exactly see how it does. It seems it would simply concatenate the "000000" on the front of the incremented result, but somehow it merges. I know I'm overlooking something in trying to understand this, but what?

UPDATE:

OK, I see it. It does merge, but then eliminates the "overflow". (This has just been one of THOSE days.)

Thanks.

Link to comment
Share on other sites

The perfect choice.

An aside: my search of the Calculation Forum this morning for "increment" didn't show any result that I could recognize as a solution. Now (after the fact)searching FileMaker's Help turns up nine topics; SerialIncrement is number six. Note to self: "must remember to try multiple resources when stumped". Consolation: "maybe someone will see these posts and learn from them".

Thanks, comment.

Link to comment
Share on other sites

This topic is 6099 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.