The Access Wizard Newsletter Tips, Tricks, and Traps for Access Users and Developers
March 2009

Flashcards 104 -- Forms. Now the Fun Begins.

Up until this point, we've spent our time talking about tables and fields. At this point in the process of creating the flash card program, we've finally reached the point where we can begin to create the forms that we will use to interact with program.

This will be gratification time -- we will actually see what the user will be seeing.

In this Issue
  • Tip of the Month - Get the Time from a Date/Time Field
  • Our Major Forms
  • A Single Record Form
  • Where Do We Go From Here?
  • Trap of the Month - Don't Forget To Back Up Your Database

  • Our Major Forms

    When we think about what we need for our application, it comes down to two basic forms:

    1. A form to work with individual records.
    2. A form to work with sets, or stacks, of records.

    This month, we will tackle the form that allows us to interact with a single record.

    A Single Record Form

    Below is the form to be used for testing a stack of flashcards, and for entering and managing words within a stack.

    When a test stack is selected from the menu (which we will construct), this screen will appear. The cursor will land on the Select Card Stack combo box, and the user will be presented with a list of potential stacks to test. For this demonstration, I have chosen animals.

    Once a selection is made, the first word in that particular stack will appear. For the purposes of development, I have a control called Flash Card Set on the form, which represents the key to the selected stack. When I put the application into development, I will hide this control, as well as other selected controls.

    For the user, the major controls on the form are the English word, the Italian word, and the area in which the user will enter an answer. The Status combo box in the lower right hand corner denotes the status of the flashcard. The textbox called Key is the key to the particular flashcard being tested. The checkbox that says LastAttemptCorrect is a field I will use to determine what action to take after the user has made an entry.

    We also have a command button, Next, which allows the user to manually move from word to word.

    All these controls will not ultimately be exposed the user. Rather, for development purposes, I have them visible so that I can to watch all the values to make sure that the program will act as expected.

    If you compare controls in this form to the data model I presented in the last couple of months, you can see that many of the controls (e.g., English, Italian, Notes) correspond directly to fields in the database.

    Also note that I have eliminated the ability of the users to close this form by clicking the red X in the upper right-hand corner. I have intentionally removed this option. In its place, I've provide an exit door in the upper left-hand corner of the form. I do this so that I control what happens when a user leaves the form. Although there may be no immediate need for this level of control, it is part of my standard development practice, so it will be there if I need it.

    A couple of other items to note: I've maintained at the bottom of the form the ability of users to see which record they are working with and how many records are in a particular stack.

    Also note that I have two labels on the form, one next to Italian called Success and another called Wrong. I've given these red and green colors consistent with stop and go. I'll show and hide these dynamically to provide user feedback.

    Where Do We Go From Here?

    At this point I've shown you the most important form in the application and explained its various controls. The critical stuff happens behind the scenes. This includes the properties of the controls, as well as the code that will control what happens as the user interacts with the form.

    Next month, we'll go behind the scenes of this form to look at the properties and events associated with the major controls on the form.

    As you may have intuited by this point, the process to build this type of application is intense. Almost none of the controls on the form have been selected casually. As I've developed this form, certain ideas I had originally were proven ineffective, and I have added others as I have found various needs. For example, originally I had no place for notes about a particular flash card; the notes field did not exist. However, as I began actually using the program, I felt it was important to allow an area for the user to write a note about any single word so that he or she could have a little mnemonic help along the way.

    Trap of the Month - Don't Forget To Back Up Your Database

    Without exception, every single hard drive ever manufactured will fail. Since hard drives are mechanical devices, at some point one of the components will stop working properly, and your data will be inaccessible. If you've had this happen to you, you know the value of a back up. I think most of you are already sold on this idea of a daily backup.

    In addition to a daily backup, you should also do a database backup any time you're going to be making programmatic changes that affect more than a single record in your database.

    I was recently helping a customer's Information Technology Director manipulate a live application. As part of the process and before we began our work, we made a backup of the data file. As it turns out, along the way we took a step that invalidated hundreds of records in the database. Because we had a backup, we were able to recover without incident. This alone saved tens, if not hundreds, of hours of work. It took us about five minutes to make the backup. The math speaks for itself.

    Tip of the Month - Get the Time from a Date/Time Field

    Last month, I talked about how to get the date portion of a date time field. To do that, we used in the DateValue function. If we want to get the time value from a date time field, for example we wanted to do some time math between two different events, what tool do we have to make that happen?

    The DateValue function has cousin called TimeValue. The use of time value is exactly the same as the use of date value. The difference between the two is that it returns the time value of the date time field rather than the date value.

    In a future wizard, I'll be talking about time math and, at that point, I'll show the use of the TimeValue function in detail.

    Quick Links...

    Custom Software Home

    Access Wizard Archives

    Our Services

    Join our mailing list!

    Forward email

    Safe Unsubscribe
    This email was sent to jim@custom-software.biz by jim@custom-software.biz.

    Custom Software | Copyright Custom Software All Rights Reserved | Westford | MA | 01886