Many FileMaker Pro solutions serve the needs of various levels of workers in an organization. The data entry clerks value efficiency, so they want to be able to open the solution and get right to where they need to go to do their jobs. The management most likely wants to see the information in the database sliced and diced in a different way, and may never need to see the data entry screens. When different categories of users need to access your database for different purposes, how can you help them efficiently get to where they need to go?

Figure 1: Create accounts -- For this example, you'll need accounts like these set up in your "Manage Accounts and Privileges" window.

Figure 2: An example of a possible opening script -- This script detects which Account is being used, and navigates to the proper layout and found set on that basis.

Figure 3: "File Options" dialog -- Notice that under "When opening this file," you see "Perform Script" selected, and that under "When closing this file," "Perform script" is again selected.
You designate any script to run upon the opening or closing (or both!) of a file, which you can do with just a few mouse-clicks. Okay, really, you need two things: Accounts and an opener script that checks those accounts upon login.
You can use the technique described in the article on any of your own files, but I've created specific exercise for you in an example file. Subscribers can download it to see how open and close scripts work.
Let's use an invoice database as an example. Your co-workers use this database to create and send invoices, and the bosses use it to view a list of the invoices. You'd like to have the workers, when they open the file, immediately see a new blank invoice ready for data entry. But you'd also like the bosses, when they open the file, to see a complete list of all the invoices created. How will you serve both types of user? You'll set up a script to run upon file open, of course!
First, you'll need separate accounts for bosses and workers (figure 1). To set up these accounts, go to the "Manage Accounts and Privileges" dialog. For this example, just call the two types of account "Boss" and "Worker." (For more information about setting up accounts, see Maria Langer's article, "Secure Your FileMaker Pro Databases.")
Second, set the script to run when anyone opens the file (figure 2). For simplicity's sake, name the script "Opener." It might look something like this code:
If [Get ( AccountName ) = "Boss"]
Go to Layout ["List" (Invoice)]
Show All Records
Adjust Window [Resize to Fit]
Else If [Get ( AccountName ) = "Worker"]
Go to Layout ["Entry" (Invoice)]
Adjust Window Resize to Fit]
Show All Records
Show Omitted Only
New Record/Request
End If
Finally, set your "Opener" script to run whenever anyone opens the file. You do this in the File Options dialog, which is under the File menu (figure 3).
This dialog, with just a few checkboxes, lets you specify a default Account and Password for the user to sign in on, a default initial layout to display, and which scripts to run upon the opening and closing of the file. In this example, however, do not select "Log in using" unless users are comfortable with bypassing the auto login.
In this example, when a manager opens the file using the "Boss" account, he'll see a list of all invoices in the database. But when a non-manager opens the file using the "Worker" account, he'll see only a single blank invoice, ready to fill in.