September 23, 200421 yr I'm wanting to be able to keep a set of records, some assigned invoice numbers and others that have no invoice numbers but I want them all in one database. What I had in mind was being able to click on a button which would enact a script to assign a unique invoice number. Since my invoices are sorted by year and look something like "0484323" with the first two digits being the last two numbers of the year. So you can create a new record and "if" you need a new invoice number, click on the button and presto chango! lol And if you don't need a new invoice number, once you create the new record you simply enter the data requested and move on. I believe I will need to use multiple fields to do this. I'm thinking I will need a date field with an autoenter date. Then a calculation field to take only the last four digits. So when the date field displays 9/23/2004 the calculation field will only display 04. The problem is how do I combine this with a serial number which is only applied to records selected by the user? I hope this makes sense. Any ideas?
September 24, 200421 yr Author This is what I came up with........any suggestions? http://home.insightbb.com/~cruxy/InvoiceNo.fp7
September 26, 200421 yr Your solution does a fine job of assigning Invoice numbers but it does not check to be sure that they are unique. It sounds like you may have a smattering of pre-existing numbers. How will you be sure that the same number isn't used twice?
September 26, 200421 yr Author Ahhhh..........Finally someone to bring me off the edge of this cliff! I guess that never occured to me, lol.......a simple matter of making of making the invoice number unique. Thanks for the reply!
September 26, 200421 yr First off, I wouldn't say it was a stupid question at all. Good question actually. The dumb ones are the ones nobody asks (IMHO). Just an thought here, maybe you could put the numbered invoices in another table - temp table, then when you create a new invoice number in your 'real' table, do a lookup to see if it exists in that table already. If you have a really large number of these already number invoices this might not be feasible, don't know. Another thought is if you set the tables field to generate new records after the ones you have already populated then. When you create a field you can set it to generate a serial number automatically. You can also use a calculation too. So your calculation could return (the year + number + whatever) and check off unique - wouldn't that maybe help? just a suggestion. I'm not a pro in FM - yet. <g> hope that helps sincerely, J__
September 27, 200421 yr Author Hmmmmm......well, I will have to give that a try J. Your making me wonder if this isn't one of thos "KISS" (Keep It Simple Stupid) situations? I'm going to give your idea a run and see what comes up. Thanks a ton!
Create an account or sign in to comment