August 29, 20178 yr 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. Thanks, as always, for any insight or push in the right direction! Auto-increment Based on Parent Value.fmp12
August 31, 20178 yr 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 August 31, 20178 yr by vwgtiturbo Clarification
Create an account or sign in to comment