Others

Fix Access 2010 Error 3270 When Changing a List Box Color

Rana GarciaRana Garcia Nov 20, 2026 869 views

Question details

The user needs to change a list box's background color on a double-click without triggering Error 3270.

Fix Access 2010 Error 3270 When Changing a List Box Color
Product
Microsoft Access 2010
Device & OS
not provided
Scenario
A user double-clicks the VendorName list box on an Access form to change its background color.
Observed behavior
Access displays Runtime Error 3270, “Property not found,” when the color change is attempted.
Before you start

Open the form in Design View and select the list box. On the Property Sheet's Other tab, check its Name property; the VBA examples below assume the control is named VendorName.

Solution 1Recommended

Set the list box BackColor directly in its event procedures

Use the list box control's BackColor property to change its background on a double-click and restore it when the control loses focus.

1
Open the double-click event

In Design View, select the VendorName list box and open the Property Sheet. On the Event tab, select [Event Procedure] for On Dbl Click, then click the ellipsis button to open the VBA editor.

2
Set the background color

In the VendorName_DblClick procedure, use this code: Private Sub VendorName_DblClick(Cancel As Integer) Me.VendorName.BackColor = vbYellow End Sub

3
Restore the color on focus loss

Return to the Property Sheet's Event tab, select [Event Procedure] for On Lost Focus, and click the ellipsis button. Add this procedure: Private Sub VendorName_LostFocus() Me.VendorName.BackColor = vbWhite End Sub

4
Test the form

Save the form and open it in Form View. Double-click the list box to turn its background yellow, then click another focusable control to restore it to white.

Set the list box BackColor directly in its event procedures
Color and control names: Replace VendorName with the list box's actual Name property if it differs. Replace vbWhite with the original background color if the control was not originally white. BackColor changes the control background, not just the selected row.
Free Microsoft Office alternative

Work with exported Access data in WPS Spreadsheets

WPS Office is a free, lightweight Office alternative with a familiar interface. Export Access data to Excel format and open it in WPS Spreadsheets for an easier transition to spreadsheet editing. WPS does not fix Access VBA errors or run Access forms.

Review and format data exported from Access in a spreadsheet.Open and edit Microsoft Excel XLS and XLSX files.Use a familiar spreadsheet interface for everyday tasks.Move exported data into a free, lightweight Office suite.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Access show Error 3270 when I change the list box color?

Error 3270 means Access could not find a property referenced by the code. Check that the code addresses the list box control and sets its BackColor property directly, such as Me.VendorName.BackColor = vbYellow.

How do I find the list box's control name?

Open the form in Design View, select the list box, and check Name on the Property Sheet's Other tab. Use that name after Me. in the event code.

Can I restore a color other than white?

Yes. In the list box's LostFocus event procedure, replace vbWhite with the original color value. For example, 16777215 represents white.

Will BackColor change only the selected list item?

No. Setting the list box's BackColor changes the control's background, not just the selected row.

Where can I learn more about Access VBA properties and events?

In the VBA editor, place the cursor on a property or keyword and press F1 for help. You can also use View > Object Browser and search for Access controls, properties, and events.