Jump to content

Print Script-Using current record


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

Recommended Posts

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 ]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7278 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
 Share

×
×
  • Create New...

Important Information

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