Applecore Pages on Microsoft Access

Creating an Access Database - Step 4: The Forms - The Switchboard Form

This is going to be the form that will be displayed when the application starts, and will enable the user to navigate to the other parts of the database. As such, it is only going to have 5 buttons on it. Access does have a built-in Switchboard Manager Add-In, but I find that this doesn't give you great flexibility. The switchboard form will also perform any required actions on the start-up of the database. For example, if this was a database that was linked to another database (for example, all of the data was held in a separate database), we could check here whether the path to the linked database was still valid.

Start by creating a new form, and add five command buttons to the form. Make the command buttons 1cm by 1cm in size, and align them vertically. From the top down, give them the following names:

  • cmdOpenBand
  • cmdOpenRecord
  • cmdOpenSearch
  • cmdOpenPrint
  • cmdQuit
Remove the captions from these buttons, and add labels next to each of the command buttons, with captions like "Band Details", "Record Details", "Search for a Track", "Print Options", "Quit the application".

Set the following properties for the form:

Caption Switchboard
Scroll Bars Neither
Record Selectors No
Navigation Buttons No
Dividing Lines No

We then need some code behind the form, in order to get these buttons to perform as required:

 
Option Compare Database
Option Explicit

Private Sub cmdOpenBand_Click()
    DoCmd.OpenForm "frmBand"
End Sub

Private Sub cmdOpenPrint_Click()
    DoCmd.OpenForm "frmPrint"
End Sub

Private Sub cmdOpenRecord_Click()
    DoCmd.OpenForm "frmRecord"
End Sub

Private Sub cmdOpenSearch_Click()
    DoCmd.OpenForm "frmSearch"
End Sub

Private Sub cmdQuit_Click()
    Application.Quit
End Sub

Private Sub Form_Open(Cancel As Integer)
    DoCmd.Maximize
End Sub

You can now save this form as frmSwitchboard, and close it.

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 15:01:44