Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple Serial Numbers - Maybe??

Featured Replies

  • Newbies

What I'm attempting to create a unique number for each record based on another field. That is, I have 2 fields, "type" and "ID". Type has 2 choices "A" & "B" the ID will get a number based the the choice made in "Type". So when a new record is created, if "A" is chosen, ID will be Filled with 1, 2, 3, etc. If "B" is chosen, It will be filled with 1, 2, 3, etc. I've gotten this to work using the count function, but, if an earlier record is deleted, then a number is repeated, due to the fact that it's just counting the number of records containing "A" or "B".

Any suggestions?? Also, I'm using FMP V6 would I be better off upgrading to V8.5 to resolve this??

TIA

Jamie

My first suggestion would be to not do this. Or at least, don't use it as a primary key.

However I have a policy of always answering the question that was asked, so: try using the Max function rather than the Count. E.g.;)

Max(all related::A) + 1

Another option might be a one-record Preference table (a file in FM6) with A and B number fields that you increment when new records are created, keeping track of the next numbers to use. This would require controlling creation of new records with a script.

  • Author
  • Newbies

Fitch,

I've followed your first bit of advice - I'm not using this as my primary key. AS far as everything else goes, I ended up using the "MAX" Function and that doing exactly what I want to do.

Thanks for the advice.

Jamie

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.