NZMac.com - Supporting the New Zealand Mac community : Saturday, 17 May 2008
April stats: 26,112 Visits - 594,859 Hits
Making a FileMaker movie review database Print
Written by Philip Roy   
Wednesday, 01 January 2003
Article Index
Making a FileMaker movie review database
Page 2

NZ Macguide Issue 7 & 8

The intention of this tutorial is to teach you some good design principles when working with FileMaker and, most importantly, see you end up with a great little database. We're going to build a movie review database that will also keep track of the movies you own, and we will search the Internet Movie Database (www.imdb.com) to find out more about the movie.

Creating the fields in the database

The database will have four screens or layouts; the Splash screen, a Movie Info screen, a Search screen and a screen where multiple movies are listed after a search when more than one movie matches the search criteria. Launch FileMaker and create a new database called Movie Reviews.fp5. (Although we are up to version 6 of FileMaker, files are still named using the previous extension. Using this will allow your file to work on a PC.)

Links

FileMaker will then ask us to enter the fields for the database. Type Movie Title in the first field, set it to be a text field, and then click Create. Obviously, this is going to be the field for each record, with the movie title in it. Add a number field - Movie Year - and a text field, Review.

Next we want to provide some dummy fields when searching by title or year. In this case, we don't want every record to have to contain this temporary information, so we will use what is called a Global field. This is a field that is contained within the database, but isn't specific to any record. Type in Movie Year Temp, set this to Global, and click save. When the window appears asking you what format the field should take, say Text. Do the same for a global field called Movie Title Temp.

Next, we need a field that shows us if you own a copy of the movie. Create a text field called Collection and click on the Options button. Click on the Validation tab, and tick that you want the value to come from a value list, which you should now create.

Define a Value List called Collection Media, and give it the custom values of DVD, Video CD and VHS. Next, four fields that all link to the same value list. Actor 1, 2, 3 and 4 are all text fields that link to a list called Actor List. Create the list, and just add one Actor in for comfort's sake.

Create a global text field called Actor Temp; a text field IMDB Reference; and a global version IMDB Reference Temp; a text field Record Number; and finally, a global text field Search Temp.

The layout

FileMaker will present us with an initial layout with all the fields placed on screen. We're going to aim to produce a database that doesn't take up a lot of screen real-estate, but looks quite attractive.

FileMaker will present us with an initial layout with all the fields placed on screen. We're going to aim to produce a database that doesn't take up a lot of screen real-estate, but looks quite attractive. Name the layout by going to the view menu and choosing Layout Mode. In the layout menu which then appears at the top of the screen, change the name of this layout to Movie Info.

Select the header and footer section of the layout, and delete these. Change the background colour (I've used grey) and play around with positioning the fields that we want on screen. Delete the global fields, as these aren't needed. It's hard to describe how to lay the fields out, but bear in mind you should have the review field very large, so you can comment about the movie. Actor fields should be below each other, so you can list up to four actors in a movie.

Next to each actor make a small button, which will allow you to search for other movies any actor appears in. The Record Number field should go in the lower right-hand corner. Make images and import them to use as buttons to jump forward, backwards, and to the start and finish of all the records, as well as buttons for Search, New Record and Delete Record. Finally, import an IMDB icon, which will be used to search the IMDB site.

Over on the left of the layout screen place a small see-through box. This is so that when we later ask FileMaker to minimise the screen area, we end up with a bit of space on the side.

FileMaker will remember the way you last sorted your database. Use this as the settings for all future sorting.

Sorting

Duplicate the layout once you have finished, and rename it Splash Screen. Delete all the fields, but leave just the Search image on screen and import another image for a browse button. Duplicate this layout and call it Search Screen. Place the two fields Movie Title Temp and Movie Year Temp on screen. For the final layout, duplicate the Movie Info layout, change the name to Movie List, leave only the Movie Title and Year on the layout, go to Layout set-up in the Layout menu and change all views to List only. Finish this layout off by making or importing an image as a Got to this record button.

Go back to the Movie List layout, select each of the actor fields and go to Format, Field Format. You want the fields to be from a pop-up menu, which points to the actor list. Include the ability to edit this list and make the behaviour to allow entry into this field. This means all four actor fields will point to the same list, which can be added to. In a similar manner, format the Collection field to be check boxes from the Collection media list, and allow entry to this field.

You should be able to enter in new records and build up a list of movie tiles. In the next issue, we'll learn how to make all the images we imported into buttons, and how to make more complex scripts. To finish though, let's do a bit of housekeeping.

Plug-Ins

Many of the plug-ins for FileMaker add much-needed functionality to the program, but can also be expensive. There has been criticism that their upgrades often don't provide enough new features, instead leaving this to third party companies.
But if they build this functionality in, they risk damaging the companies that support them. It can be quite awkward when developing databases for people to have to explain that you can't do all the things you want without spending extra for a plug-in, but it would be great if FileMaker perhaps bundled some of these plug-ins with the product itself.

First, make a script by going to the script menu. Call it Sort Database if Needed and enter the following*...

If [Status(CurrentSortStatus) 1]
Show All Records
Sort [Restore, No dialogue]
End If

This says if the database isn't sorted, then sort it. You'll notice that it says to restore the last sort, so we need to tell FMPro how we want the database sorted. Go to the Sort command in the Record menu, and move the fields Movie Title and Movie Year across to Sort By. FMPro will then sort and remember this as the way we want to sort.

Finally, I like to have a start-up script I can add to in future if I need anything done. So, create a script called On Startup and enter the following.

Enter Browse Mode
Toggle Status Area [Hide]
Toggle Text Ruler [Refresh window, Hide]
Perform Script [Sort Database if Needed]
Toggle Window [Zoom]

The toggle window command will shrink the database window down to a nice size. To get this script to run, go to the FileMaker Pro menu in OS X, choose Preferences for the document and indicate to switch to the splash screen layout on start-up and perform the script On Startup.

Startup options

Setting your the database to perform a script and go to a ceratin layout on startup



Last Updated ( Sunday, 07 January 2007 )
 

Related Articles

Advertisement
Site developed by Bluengrey.com :: Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates by Compass Design