Hack 23. Use Custom Controls on Your Forms
Move past standard Access controls, and discover new design possibilities.
If you develop enough Access applications, you begin to take the Toolbox for granted. You know all the controls and when to use them. But did you ever notice the Toolbox has a button that leads to more controls? Figure 3-17 shows where this button is located.
Figure 3-17. Finding additional controls
Clicking the More Controls button opens a list of new controls from which to select. I don't suggest testing all of them because I think that some aren't useful in Access. However, if you scroll to the Microsoft controls, you might find some interesting ones to try on a form. Let's see how we can use a few of these custom controls.
3.6.1. Adding a Custom Control to a Form
The list of controls will probably differ between computer systems, but it's a safe bet that you have the Microsoft Forms controls loaded on your computer because they are installed with Microsoft Office.
As an example, I placed a Microsoft Forms 2.0 spinbutton control on a form, as shown in Figure 3-18. I did this by simply selecting it from the long control list and then drawing on the form using the mouse.
Figure 3-18. A spinbutton control on a form
The spinbutton control has minimum and maximum value properties that you can set. Therefore, you can use the spinner to cycle through from 1100, 128133, or whatever makes sense for your application. You can access the spinner's value from code in the same way you do for other controls.
Next, I put the Microsoft Date and Time Picker Control 6.0 on the form, as shown in Figure 3-19. This nifty control stays in a collapsed state until you click it. It then opens to a scrollable calendar. This is a great user enhancement; users don't have to enter dates manually when you put such a control as this on a form. And the good thing about this control is that it remains small when it's not in use.
Figure 3-19. Making it easy to select a date
It's useful to become familiar with a few of the new controls and to think of them as part of your control toolbox. This opens the door to new ways to design forms, and it provides users with an enhanced experience.
3.6.2. See Also