Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to make a main menu for a database

In Base by Zaweba, Create > Switchboard builds a menu form with a button for every form, report and query, and offers it as the start-up form.

How to make a main menu for a database

In Base by Zaweba, Create > Switchboard builds the menu for you. It makes a form with a button for every form, report and query in the database, and offers to make it the start-up form, so the database opens straight onto the menu. You can then rearrange it, rename the buttons, and remove anything people don't need.

A menu like this turns a database into something anyone in the office or club can use without knowing what a table or a query is.

What the switchboard gives you

The switchboard is an ordinary Base form with no table behind it. Forms without a table show only labels and buttons, which is exactly what a menu is. Each button already has its action set: open a form, print a report or run a query.

Because it covers everything, the first version is usually too long. That's fine. It's a starting point that saves you making each button by hand.

Trimming and arranging it

Open the switchboard in the form designer. Delete buttons for things only you use, such as setup queries or test forms. Move the important ones to the top. Change each button's text to describe the job rather than the object: "Add a new member" reads better than "Members form", and "Print renewals due" reads better than the report's internal name.

Labels can group the buttons under headings, for example Day to day, Reports and Year end. Move controls by dragging, resize them from the corner handle, and nudge them with the arrow keys on the 8 pixel grid to keep things lined up.

Buttons that do more

A button isn't limited to opening things. The actions available include opening a form, running a query, printing a report, going to the first, previous, next, last or a new record, saving, deleting, exporting to CSV, and running a script.

Scripts are short pieces of JavaScript in a sandbox. They can look things up, ask a yes or no question, and add or change records. Access-style functions such as DLookup, DCount, MsgBox and InputBox are available. A menu button could ask "Close the month?" and then run a few updates, all in one press.

For a bigger database, one long menu becomes hard to scan. Make a few smaller menu forms, one for sales, one for stock, one for reports, and have the main menu's buttons open them. Each sub-menu can have a button back to the main one. It's all done with the same open-a-form action.

Making it the first thing people see

When the switchboard is created, Base offers to set it as the start-up form. You can also set or change the start-up form later from the Database menu, or by right-clicking a form in the navigation pane. The Database menu also lets you set the application title in the window, which is a nice finishing touch: the title bar can say "Riverside Bowls Club" instead of a file name.

Templates do this already

If you're starting a new database, the five templates (Contacts, Inventory, Invoices and Customers, Book and Collection catalogue, and Simple CRM) each open on their main form. Have a look at one to see how a finished front end hangs together before designing your own.

What the website gets instead

Buttons and scripts stay in the desktop app. When Base by Zaweba exports the database as a PHP and MySQL website, the site gets standard pages instead: a list, view, add, edit and delete page for each table, plus read-only pages for saved queries and reports.