Troubleshoot controls

Troubleshoot expressions, data display and formatting, and the field list

#Error? or #Name? appears in a control.

#Error? or #Name? may appear in a control for a number of reasons. To correct the problem, do the following:

I'm seeing unexpected results when I try to refer to a column in a list box or combo box in an expression.

You use the Column property to refer to a column in a list box or combo box. The Column property might produce unexpected results for any of the following reasons:

When I try to create a bound control, the Field List isn't available.

If you are working in a form or report, you might need to bind it to a record source.

If you are working in a data access page, you might need to connect it to a database.

I can't use text that contains an ampersand as a label or as a caption for a command button.

Microsoft Access uses a single ampersand in a label or button to define an access key. Therefore, if you want to use an ampersand (&) in a label on a form or report, you must type two ampersands. For example, if you want the text "Products & Suppliers" to appear in a label, type Products && Suppliers.

When I bind a control to a field, the control doesn't inherit some of the properties from the field

If you bind a control to a field, or if you change the underlying field for a bound control, Microsoft Access doesn't set the property settings for the control to the corresponding property settings for the underlying field. In forms and reports in an Access database, ValidationRule, ValidationText, and DefaultValue property settings in the underlying field will be applied, however, because these properties are enforced for the field, not just the control.

I chose a raised or sunken appearance for a control in a form, but the three dimensional effect doesn't appear.

Double-click Display in Microsoft Windows Control Panel, click the Appearance tab, and then click Windows Standard in the Scheme box.

I can't select multiple controls at the same time in a data access page.

To select multiple controls in a data access page, you must have Microsoft Internet Explorer 5.5 installed.

Troubleshoot a control's property sheet

Why is the property sheet blank?

If the property sheet is displayed and you click a control that's already selected, the property sheet will go blank. If you don't need to type a value in the control, press ESC to redisplay the property sheet. Otherwise, type a value and press ENTER.

Why is the property box for a particular property blank?

If the property setting for a particular property is the same for all selected controls, that setting appears in the property sheet; otherwise, the property box for that property is blank. If you have multiple controls selected, and you change a setting for a property in the property box, that change affects all selected controls.

Why don't I see all the properties in the property sheet?

If you select multiple controls but don't see the properties you expect in the property sheet, you may have selected a control that you didn't mean to select. For example, you may have included a line in a group of text boxes. Properties appear in the property sheet only if they apply to all of the selected controls. To remove a control from a group selection, hold down the SHIFT key and click the control.

Why don't the property settings for my control match the settings in table Design view?

The property settings for a bound control might not match corresponding settings in the field in the underlying table that the control is bound to. If the settings are different, the form or report settings typically override those in the table, but they apply only to the current form or report. It's generally a good idea to set the Format, DecimalPlaces, InputMask, ValidationRule, ValidationText, and DefaultValue properties in the underlying table or query rather than in the control. This way, you can be sure that you have consistent settings for the field whenever you add it to a form or report.

Troubleshoot a group of controls

I can't group text boxes or other controls.

You must select more than one text box or other control at a time in order to create a control group.

I can't ungroup selected text boxes or other controls.

You can ungroup selected text boxes or other controls only when one group at a time is selected on the form or report.

Troubleshoot conditional formatting in a text box or other control on a form or report

The conditional formatting I applied to a control doesn't change when I thought it would.

If you have applied conditional formatting to a control, then Microsoft Access applies the formatting depending on whether the control value or other evaluated data meets a condition that you specified.

Access isn't applying conditional formatting correctly to a control on my form or report.

Troubleshoot check boxes, toggle buttons, option buttons, and option groups

I added a check box, toggle button, or option button to an option group, but the option group doesn't work.

You might have placed the control outside the option group. When you add a check box, toggle button, or option button to an option group, Microsoft Access highlights the option group to show that the control will become part of the option group. If the option group isn't highlighted, you're probably placing the control too close to the edge of the option group.

The option group on my data access page doesn't show or save data correctly.

Make sure that the controls in your option group are option buttons. You can use check boxes in an option group on a form, but not in an option group on a data access page.

Troubleshoot list boxes, combo boxes, and drop-down list boxes

The list box, drop-down list box, or combo box isn't sorted the way I want.

If you use a wizard to create the list box, drop-down list box, or combo box, Microsoft Access automatically sorts the rows that make up the list by the first visible column. If you want to specify a different sort order for a control on a form or report, click the Build button next to the RowSource property box for the control, and specify a sort order in the Query Builder or SQL Statement Builder. If you want to specify a different sort order for a control on a data access page, create a query with the sort order you want, and then specify that query in the ListRowSource property of the control.

The text displayed in the combo box is from the wrong column. How do I display data from another column?

In a multiple-column combo box on a form or report, the text box portion of the combo box displays data from the first visible column in the list. You use the ColumnWidths property to determine which columns are visible. For example, if you have a combo box that is based on a query that includes the SupplierID field and the SupplierName field, in that order, then Microsoft Access displays the SupplierID field in the text box portion of the combo box unless you hide it using the ColumnWidths property.

When I select a value in a list, it disappears or gives me a message.

You may have specified the wrong column in the BoundColumn (forms and reports) or the ListBoundField (data access pages) property box. The BoundColumn or ListBoundField property determines which column's data is stored in the field that is specified in the ControlSource property box. For example, if you have a combo box on a form or report that has a SupplierID column and a SupplierName column, the bound column would be the SupplierID column (the foreign key field) even if the SupplierName column is the only visible column.

I can't select a value in the list box, drop-down list box, or combo box.

You may have misspelled the field name in the ControlSource property box. You use the RowSource (forms and reports) or the ListRowSource (data access pages) property to specify the items that make up the list. When you click an item in the list, Microsoft Access needs to know where to store the value that you selected. You use the ControlSource property to specify where the values are stored.

#Error? appears in the combo box or drop-down list box, or the combo box or drop-down list box is blank.

In form Design view, you probably entered an inappropriate setting in one of the following properties: RowSource, ControlSource, BoundColumn, ColumnWidths, ColumnCount. To learn more about combo box properties, see Microsoft Access Help, or click the property box for the property and press F1.

I want to refer to a column in the list box or combo box other than the bound column.

In a form, to refer to a column other than the bound column, use the Column property. The Column property is zero-based. For example, to refer to the second column in the combo box called SuppliersCombo on the Products form, use this syntax:

Forms![Products]![SuppliersCombo].Column(1)

I can't type a new value in the combo box on a form.

The LimitToList property is set to Yes. Set the LimitToList property to No so that you can type new values in the combo box. If the column displayed in the text box portion of the combo box isn't the bound column, Microsoft Access automatically sets the LimitToList property to Yes.

Why isn't a value that I type in the combo box on a form added to the list?

To automatically add a value to the list on a form, you need to write an event procedure and attach it to the combo box's OnNotInList property.

Note   You must set the LimitToList property to Yes to use the NotInList event.

My list box, drop-down list box, or combo box runs too slow. What can I do to speed it up?

There are several things you can do to make your list boxes, combo boxes, and drop-down list boxes run faster:

Note   The Query Builder is not available in a data access page. Wizards are not available in a stand-alone data access page, or when you point a data access page to a database other than the one currently open. In both cases, you will have to create a list box or drop-down list box on your own.

Troubleshoot pictures and other OLE objects

When I double-click a linked or embedded object, I get a message saying the file can't be opened.

Microsoft Access displays this message when it can't open the source file for an OLE object. Check to make sure that:

I want to see the content of my object in my form or report, but I see an icon instead.

  1. Open the form in Design view or the report in Design view.
  2. Click the icon.
  3. On the Edit menu, point to the appropriate Object command (for example, point to Worksheet Object for a Microsoft Excel object), and then click Convert.
  4. In the Convert dialog box, clear the Display As Icon check box.

My picture becomes distorted when I resize it.

To keep a picture's proportions when you size it, use the PictureSizeMode property (for background pictures) or the SizeMode property (for bound object frames, unbound object frames, and image controls). If the picture is a bitmap, it's best to use the Zoom setting rather than the Stretch setting. You should also consider using a metafile rather than a bitmap since you can size metafiles without causing distortions.

How can I improve the color quality in my picture on on my form?

If the picture you're displaying was created on a computer that has more colors than the computer that you're displaying the picture on, Microsoft Windows substitutes colors to match the original colors. This process is known as dithering. For example, you may be trying to display a picture that was created with 256 colors on a computer that only displays 16 colors (standard VGA). If your computer can display more colors, you can use a form or report's PaletteSource property to specify that Microsoft Access use the color palette that was used to create the picture.

If you're using background pictures with forms that have popup forms, it's a good idea to set the PaletteSource property of both forms to the same value. This is true if the form has a background picture and the popup form doesn't, if the popup form has a background picture and the form doesn't, or if both have background pictures. Windows can use only one palette at a time, so if you set the PaletteSource property to the same value, then you ensure that the colors you need to paint each form are available when the focus moves to the popup form or back to the form.

Why did the size of my database increase significantly more than the size of the object I added?

The amount of information that is used to represent an object is often greater than the size of the object itself. One way to work around this disproportion is to display an icon in the form or report that represents the object instead of the object itself. When you display an icon, the OLE server (the application used to create the object) sends only the information needed to display the icon. When you double-click the icon, the OLE server is launched with the data that the icon represents.