Is the calculation set as unstored?
Its possible that you need a window refresh to show the value correctly. Attached is a db that does what you describe with a global variable. In this case I added a merge variable that shows the current value as the button label. So when the DB opens the label is blank. I found when I first tried it that the label didn't always update. I added a refresh window script step after the set variable and everything works as expected.
gvariable.fmp12.zip 7.7 K
I'm quite happy to use my global field solution, because even though the global field is not the "neatest" choice
I would argue that using a global field is the cleanest way of doing this:
- global fields can be accessed from other files, whereas global variables need to be set in each file (and thus kept in sync)
- global variables clutter up the data viewer and make troubleshooting harder if there are a great many of them