Skip 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.

Conditional Auto-increment via Calculation?

Featured Replies

Hi there! I've been beating my head on the desk for about a week trying to figure out an issue with auto-incrementing values in a child table, dependent on a value in the parent table, and it is driving me absolutely insane.

In a previous iteration of the DB, auto-increment was working fine, as the value to increment the field was hard coded (i.e. incrementing the value by 1 for each successive child table record created). However, through real-world use, it became apparent that this was not ideal, and that I needed to have the option of incrementing the value by 1 or by 2. So, I devised a field in the parent table for the user to select which increment should be used (1 or 2).

Unfortunately, since this time, the auto-increment has never worked. I've been experimenting with various 'If' statements, 'Case' statements, etc., and have had zero luck. I have usually had good luck in solving my own issues by creating the simplified example to post here, but this time, all of my trial and error has yielded zilch. It seems like it should be really simple, but...

I'd really love some insight into why my setup isn't working anymore. I created an example file (as I can't post the actual file used). The structure is really simple, but mimics the actual DB.

59a5fda32e955_Auto-incrementExampleStructure.jpg.f40f76a64c37fa6b1123f7457812be5d.jpg

Thanks, as always, for any insight or push in the right direction!

Auto-increment Based on Parent Value.fmp12

  • Author

Nevermind... Solved it. Strange implementation (to my novice brain), but it works. Assigning the chosen graduation to a global variable, then using the value of the variable in the child table calculation was the way to go.

EDIT: After further examination, the global variable wasn't needed. The original code works... if the record is committed. I guess when I moved on to the next record, the previous record wasn't committed, so the calculation choked. Adding a script step to commit the record after inserting the chosen increment, then pressing on with data entry, allowed the next record to evaluate the previous record's value, and increment it properly. Derp. Sometimes it's the simple things...

Edited by vwgtiturbo
Clarification

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.