Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Helpful Harry Newsgroups: comp.databases.filemaker Subject: Re: Script to Increment an arbitrary Field Date: Wed, 10 Aug 2016 08:59:57 +1200 Organization: Aioe.org NNTP Server Lines: 34 Message-ID: <100820160859573113%HelpfulHarry@BusyWorking.com> References: <0001HW.D3CFA2020811C44BB02919BF@news.astraweb.com> NNTP-Posting-Host: Urck5uDY3Nzu5kPmWbDnWA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Thoth/1.8.4 (Carbon/OS X) X-Notice: Filtered by postfilter v. 0.8.2 X-Face: vIZzK[X\z-._]-_:U?l@cBtwg<{a>ggn\mH}Vs>38E,#R%7h%U0'=4;1Q=erO %[T#a{YJfGvAbWmE@f_h], Nelson wrote: > > I'd like to format a field as a button which when clicked will > increment the underlying field by one. I can see how to do it if I > specify the field to be incremented. I can't figure out how to make a > generic script to do this which I can apply to an arbitrary field. The > problem is that hovering over the button doesn't make the corresponding > field active. > > Any ideas how to do this? It may depend on the version of FileMaker Pro you're using. In early versions it simple isn't possible. You would have to create a separate Button and Script for each Field. In newer versions you can use Script Parameters to pass which Button has been clicked to the Script, but you may still need a set of "If Then" statements to work out which Field to increment from the Parameter. I haven't got any way to check, but if you set that Parameter from each Button as the Field's actual name, then you MIGHT be able to use one command along the lines of: Set Field [ Get(ScriptParameter); Get(ScriptParameter) + 1] BUT, clicking the Field to increment its value is not a very good usability design since it's far too easy to click the wrong Field by accident. You're probably better off with a set of "+" and "-" Buttons next to each Field so the user can both increment and decrement the Field's value. Helpful Harry :o)