Jump to content

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

Recommended Posts

Posted

Hello Everyone...

I have a simple question I hope...

Setup:

10 Tables...only need an example for one I can do the rest..

Tables: Main and Policies

I would like to make a script that will only print desired records...

I have a field called Status...Is there a way to make a script that can ask me or give my choices by either pull down menu or buttons which status I want to print (Active or Inactive)

I only wish just to print one...and have the others not show up...

Help?

Joseph

Posted

Ten tables. Two tables. What are you talking about?

Posted

Sorry...

Setup:

Tables: Main and Policies

I would like to make a script that will only print desired records...

I have a field called Status (in the Policies table)...Is there a way to make a script that can ask me or give a choice by either pull down menu or buttons of which status I want to print (Active or Inactive)

Help?

Joseph

Posted

Joseph31 said:

Sorry...

I would like to make a script that will only print desired records...

A very basic need for a database, and one that is often discussed on the Forum.

Basically, you want to use FileMaker's ability to remember the last Find and Print that is performed when setting up your scripts.

Start by performing a Find for the records that are noted as Active, and then print them. Once you have your report the way you want it, immediately create a script using the script steps Find and Print. Be sure and name it appropriately.

Next do your find for the Inactive, immediately create your script using the script steps Find and Print. Be sure and name it appropriately.

HTH

Lee

smile.gif

Posted

I think what you want is to venture into the world of conditional scripting. I.e., you use IF to test for a certain condition, then proceed accordingly. Sample script:

show message(what do you want to print?)

#buttons would be "Active" and "Inactive" (and I'd include "Cancel")

#now I'd set a global field to whatever button was chosen, which is a number

Set Field(gChoice, Status (CurrentMessageChoice) )

If( gMessageChoice = 3 )

. Halt script

End If

Enter Find mode

If( gMessageChoice = 2 )

. set field( status, "Inactive" )

Else

. set field( status, "Active" )

End If

Perform Find

Page setup(restore)

Print

Another method would be to have the global text field on your layout with a value list of "Active", "Incative", and a Print button next to it. Then the script would be very simple:

Enter Find mode

Set field( status, gChoice )

Perform Find

Page setup(restore)

Print

Of course there are other issues to consider, such as what if no records are found, so you'd Set Error Capture On before Perform Find, and then If( Status (CurrentFoundCount) = 0 ) do something. Also, with a simple find request like this, GTRR (i.e., go to related record) can be much quicker than a Find. But that's probably more than you wanted to know.

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