Jump to content

Serial Number needs to reset each new month


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

Recommended Posts

Hi Folks - this forum is just sooooo helpful!

Thanks to a fussy bookeeper, I have a new problem with automating serial numbers for invoicing.

This current calculation:

[color:red]( If ( Month ( Sale Date) < 10 ; "0" ) & Month ( Sale Date) & Right ( Year ( Sale Date) ; 2 ) & newSerial# Invoice)

returns:

03060000

03060001

03060002

03060003

etc… with each new record.

However - now I need to figure out how to automatically reset [color:red]"newSerial# Invoice" back to [color:red]"0000" at the start of each new month.

Any ideas out there?

Link to comment
Share on other sites

Not quite the correct Forum for this question....

FMP 5.5 and later have "Set Next Serial Number" script step. Thi'd be ideal for you because it saves having to go into Define Fields to change the serial number entry. Not sure if it's in FMP 5 though.

Link to comment
Share on other sites

As Vaughan mentioned, you can use the "Set Next Serial Number" script step. Also you can set the script to run automatically when your solution is opened. You'll need to keep track of when the serial numbers where last reset - in your case it seems like its incorporated into the serial number itself - but you could also store this information in global month and year fields. With a calculation you the script can test if this is the start of a new month/year and if so then reset the Serial Numbers.

Link to comment
Share on other sites

"...you could also store this information in global month and year fields"

Global fields will break in multi-user. Instead, create a "prefs" table with a single record to store the values in "normal" fields.

Link to comment
Share on other sites

"...you could also store this information in global month and year fields"

Global fields will break in multi-user. Instead, create a "prefs" table with a single record to store the values in "normal" fields.

Hi Vaughn - thanks for your reply - but I didn't really understand it. I haven't workied much with global fields. Could you go into a little more detail in relation to the fields i have described? thankx }:(

Link to comment
Share on other sites

Here is one attachment for you.

You must think about two questions:

1.Can you delete invoice for last time?

2.Can you change the date of invoice to other month?

Thanks AAA! Your solution was a tremendous help. And thanks to everyone else for your suggestions. You are all just sooo great

Link to comment
Share on other sites

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