Chapter 24: Optimizing Access Applications
861
l (^) Use an Image control. If the image never changes, use an Image control. Image controls
use fewer resources and display faster.
l (^) Use an Unbound Object Frame. If you need the image to be a linked or embedded OLE
object that you can edit, use an Unbound Object Frame.
Tip
If you have an image in an Unbound Object Frame that you no longer need to edit, you can convert the
Unbound Object Frame to an Image control by right-clicking the control and choosing Change To ➪ Image
from the pop-up menu.
Tip
When you have forms that contain unbound OLE objects, close the forms when they aren’t in use to free up
resources. Also, avoid using bitmaps with many colors — they take considerably more resources and are
slower to paint than bitmaps of the same size with fewer colors.
Note
If you need to display an unbound OLE object but don’t want the user to be able to activate it, set its Enabled
property to False.
Speeding up list boxes and combo boxes
It’s important to pay attention to list boxes and combo boxes when optimizing your application.
You can take a number of steps to make your combo boxes and list boxes run faster:
l (^) When using multipage or tabbed forms containing list boxes or combo boxes on more
than one page, don’t set the RowSource of the list boxes or combo boxes until the actual
page containing the control is displayed.
l Index the first field displayed in a list box or combo box. This enables Access to find
entries that match text entered by the user much faster.
l Although it’s not always practical, try to refrain from hiding a combo box’s Bound col-
umn. Hiding the Bound column causes the control’s searching features to slow down.
l If you don’t need the search capabilities of AutoExpand, set the AutoExpand property of a
combo box to No. Access is then relieved of constantly searching the list for entries match-
ing text entered in the text portion of the combo box.
l (^) When possible, make the first nonhidden column in a combo or list box a text data type,
and not a numeric one. To find a match in the list of a combo box or list box, Access must
convert a numeric value to text to do the character-by-character match. If the data type is
text, Access can skip the conversion step.
l (^) Often overlooked is the performance gain achieved by using saved queries for
RecordSource and RowSource properties of list boxes and combo boxes. A saved
query gives much better performance than an SQL SELECT statement because an SQL
query is optimized on the fly.