Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Counter starts 001 when reaches 1000 returns 001


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

Recommended Posts

  • Newbies
Posted

I am keeping my test simple. Just use a text box with no special formating and its only goal is to start counting at 001 to 1000 ( This number should change with every new record that is made). But when it reaches 1000 it starts over the counting with 001. I have tried many methods and failed I will try what ever anyone comes up with.

Vince

Posted

Case( counter = 999, "1" ) & Right( "00" & NumToText(counter + 1), 3 )

Use it either in a Set Field when a new record is created or as an auto-enter calculation. Make counter a field in a preferences file which contains only one record and relate any files that require access to the counter using a constant calculation (or auto-enter) of 1.

Posted

Hmm. I read this as wanting 001 to 1000, then 001 again.

Otherwise you need to account for adding 2 so that 999 will go to 1001.

Right( "00" & NumToText(counter + 1 + (counter = 999)), 3 )

Posted

If you want 1000 to return 1, then the logic would be that a counter of 1 returns 2 I'd think.

Then Right("00"&(Mod(1+number,1000)),3) should do it.

You may explain the exact purpose of this though.

Posted

You need to NumToText it and then it should work. Seems a bit more complicated than mine though. wink.gif

Oh, and you need to add 1 to the number so it will increment.

This topic is 7334 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.