Jump to content

Incrementing a non specified field.


This topic is 8294 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am creating a database for our production line. One of the features that I need to implement is the capability of the operator to click in a field and hit an increase or decrease button. I have about 100 fields right now that the operator can enter numeric information. How do I get the script to recognize the "chosen" box at the time they hit the increase or decrease button?

Thank you in advance.

Link to comment
Share on other sites

Well, I can think of two ways to do this. One is very complex but can be done with straight FileMaker. The other is much simpler, but needs AppleScript.

Here's the script given only FileMaker:

code:


If [ Status( CurrentFieldName ) = "Field1" ]

Link to comment
Share on other sites

Well, I can think of two ways to do this. One is very complex but can be done with straight FileMaker. The other is much simpler, but needs AppleScript.

Here's the script given only FileMaker:

code:


If [ Status( CurrentFieldName ) = "Field1" ]

Link to comment
Share on other sites

quote:

Originally posted by Chuck:

Well, I can think of two ways to do this. One is very complex but can be done with straight FileMaker. The other is much simpler, but needs AppleScript.

Here's the script given only FileMaker:

code:
If [ Status( CurrentFieldName ) = "Field1" ]

Link to comment
Share on other sites

There shouldn't be any problem as far as reports go. The two methods do the exact same thing. AppleScript is able to do it with much less code because AppleScript can set the contents of a field when the name of the field is held in another field. FileMaker alone can't do this.

Chuck

Link to comment
Share on other sites

quote:

Originally posted by Chuck:

There shouldn't be any problem as far as reports go. The two methods do the exact same thing. AppleScript is able to do it with much less code because AppleScript can set the contents of a field when the name of the field is held in another field. FileMaker alone can't do this.

Chuck

Thank you for your response. I am doing something wrong though, when I try to run the AppleScript is keeps telling me "Object could not be found Error -1728" and puts an odd mix of letters in the "gCurrent

This is the AppleScript I have entered for the script:

set ( cell ( cell "gCurrent Field" of layout 2 of database "Prodata Workcenter.fp5" ) ) to ( ( cell ( cell "gCurrent Field" of layout 2 of database "Prodata Workcenter.fp5" ) of layout 2 of current record of database "Prodata Workcenter.fp5" ) + 1 )

Link to comment
Share on other sites

Try breaking it up. I put it all in one line, for which I aplogize, but this will do the same thing:

code:


Set Field [ gCurrent_Field, Status( CurrentFieldName ) ]

Perform AppleScript [

set CurrentField to (cell "gCurrent_Field" of layout 0 of database "File.fp5")

set CurrentNumber to (cell CurrentField of layout 0 of current record of database "File.fp5")

set (cell CurrentField of layout 0 of current record of database "File.fp5) to CurrentNumber + 1

]

See if that helps, since you can test each step one at a time to see where the problem might be more accurately.

Chuck

Link to comment
Share on other sites

This topic is 8294 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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