Jump to content
Server Maintenance This Week. ×

Combining fields/values in a button?


gbrozak

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

Recommended Posts

I working on a database to automate our scholarship notification to students. I have it just about done, and want to be able to create a button that looks at the information I've given, and takes me to the CORRECT individualized letter I've created (with data for that need). Let me explain:

We have student who are going receive an academic scholarship and a housing scholarship. Some can just receive a housing scholarship, and others will just receive an academic scholarship. I have individualized letters with this data already entered.

What I want to do is make this an automated process, so a secretary, etc. can click a button once the award information is entered, and FM will look at two fields (radio buttons of a Value List) and print the correct layout/letter.

The two fields both have 2 Value List entries:

A B

Yes NO

I know FMP will need to evaluate both fields. What I don't konw how to do is to tell it how to look at them an decide where to do. I know how to create/assign a button. But do I use an "IF" statement? It's the scripting of the A/B, Yes/No fields that is baffling me. I can't get it to make a decision to proceed to one of my layouts.

I'd appreciate any help!

George

Link to comment
Share on other sites

I think you can use a check box named "Scholarship" with the value list of "Academic" (for academic only scholarship) and "Housing" (for housing only scholarship). However, if the scholarship is for BOTH, simply check both check boxes (not radio button since radio buttons will not allow multiple values).

For your script, create a button to go to the corresponding layout and attach this script:

If (ValueCount (Scholarship) = 2)

Go To Layout ["Academic_Housing"] //this means both checkboxes have been checked and will thus send you to the layout representing academic and housing scholarship

Else if (valueCount (Scholarship) = 1) AND

(Position (Scholarship);"Academic";1;1) = "Academic")

Go To Layout ("Academic")

//If only one checkbox has been checked, verify if it is the academic one

Else if (ValueCount (Scholarship) = 1) AND

(Position (Scholarship);"Housing";1;1) = "Housing")

Go To Layout ("Housing")

//If only one checkbox has been checked, verify if it is the housing one then go to the corresponding layout

Else

Message ("Please click one or both checkboxes representing type of scholarship")

//No check box has been selected, prompt user for action

End if

End if

End if

Link to comment
Share on other sites

Try making this your script parameter:

2 * ( ABfield = "A" ) + ( YesNoField = "Yes" )

Then make your script to Go to Layout [ Layout Number by calculation ], with the calculation of:

n + Get(ScriptParameter)

where n is the number of the first of the 4 possible layouts (they have to be consecutive in the layout order).

As an aside, it is always more convenient, IMHO, to define a 2-state field as a number, with 0 and 1 as the possible values.

Link to comment
Share on other sites

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