Jump to content

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

Recommended Posts

Posted

This question may have been addressed before, and I think I may have read it some time ago. If so, I am sorry. But here I go:

I am trying to think of a way to not show in-active records, ie. I have created a file for my students. One of the fields is a "status" field with a drop down list of "Active, Absent Short term, Absent long term, stopped." What I would like to do is omit all the "stopped" records. I know I have to make a script and apply it to the "open" script that is run when the document is opened. But I don't know excatly how to layout that part of the script. If someone could give me a hand, that would be great.

Thanks for everything everyone has done on this site.

Posted

Hello Himitsu,

There are various ways this can be done, but one of the most straightforward is to script a find procedure into your opening sequence. Something along the lines of:

Go To Layout ["LayoutWhereTheStatusFieldIsLocated"]

Enter Find Mode [ ]

Set Field ["status", " "stopped" "]

Omit Record

Perform Find [Replace Found Set]

- which, when included in your opening script, will ensure that the inactive records are omitted each time the file opens. cool.gif

Posted

Ray,

Thanks for the example but as I do it, I can do the "set field["student status"]" but I can't see how to enter the feild value in it. I guess I am still to much of a beginner to understand it.

Posted

Hello Himitsu,

When you have the Set Field [ ] command appearing in the main (right-hand) panel of the ScriptMaker script definition dialog, select it and you will then see two buttons at the lower right of the window. One is labelled 'Specify Field' and the other is labelled 'Specify'.

Double clicking on the Set Field [ ] command in the script definition panel, or clicking the 'Specify Field' button at the lower right allows you to choose a field to target. You've already done that, it seems.

The other step - specifying the value to set - can be accomplishewd by clicking on the 'Specify' button, or by Alt-doubleclicking (Windows) or Option-doubleclicking (MacOS) the Set Field [ ] command in the script definition panel.

When you do this you will be presented with a dialog in which to enter a calculation formula (similar to the calc dialog which appears when you are in the Define Fields window). In this instance the formula you will need to enter is just the word 'stopped' in double quotes, thus:

"stopped"

When you've done that and clicked the 'OK' button to accept the formula, the Set Field [ ] command should then appear in the script definition panel in the format I posted above. Ie:

Set Field ["studentstatus", ""stopped""]

Give it a try and let us know if you're still stuck. wink.gif

Posted

Ray,

That works great... I just didn't know I had to use the " mark. Thanks a ton. That saves me a week worth of banging my head on the wall.

This topic is 7790 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.