| Making a FileMaker movie review database |
|
| Written by Philip Roy | ||||||||||||||||
| Wednesday, 01 January 2003 | ||||||||||||||||
Page 1 of 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.
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.)
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.
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.
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. 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.
First, make a script by going to the script menu. Call it Sort Database if Needed and enter the following*...
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.
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.
|
||||||||||||||||
| Last Updated ( Sunday, 07 January 2007 ) | ||||||||||||||||






