November 14, 200124 yr Hello All! I am working a db application that tracks conduct/discipline for a school principal. I need to set up a script to print a certain layout dependent upon a text value in a particular field. For example:In the current record IF the Field Punishment_ID = "001" then go to layout "ISR Letter" and print 3 copies using the current record IF the Field Punishment_ID = "003" then goto layout "Suspension Letter" and print 3 copies using the current record...I am new to this so I am not sure what the procedure to do this would be. Thanks [ November 14, 2001: Message edited by: Matt Johnson ]
November 15, 200124 yr No that won't work. We aren't interested in the field name. If [ Field Punishment_ID = "001" ] Go to layout [ "ISR Letter" ] Print [] Else If [ Field Punishment_ID = "003" ] Go to layout ["Suspension Letter" ] Print [] End If End If Note that the function to "print 3 pages" is best done by the user when the print dialog box appears, rather than issuing the Print [] step three times. Note also that if the Field Punishment_ID is neither 001 nor 003 then the script as written above won't print anything, but this is the logic you have described in your post.
November 15, 200124 yr Author Thanks Guys. I worked it out but did it a little different. The main problem I had was that "001" was not the true value, but "1" was really the value. After I got rid of the zeros it worked. Now I will have to make another post because I need to do some reports which probably entail some calculations...I getting better at all of this!
November 15, 200124 yr Just off the top of my head: You can have the script go to the appropriate layer automagically by using Go to Layout (by # from a field), and specify Punishment_ID as the layout # to go to. Or, at least, a calc field based on Punishment_ID. e.g. If Punishment is Suspension, Punishment_ID=3, Go to Layout 3, which would be Suspension Letter. Hope this makes sense.
Create an account or sign in to comment