Fix "You can't assign a value to this object" Access Error When Resetting Check Boxes
Question details
The user encounters a VBA error when attempting to programmatically reset check boxes in an Access form.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Using VBA code to reset multiple check boxes to False on a form.
- Observed behavior
- Microsoft Access throws the error message "You can't assign a value to this object". This often occurs because the control is actually bound to data or contains an expression in its ControlSource property.
Verify that the check boxes you intend to reset are truly unbound by opening the form in Design View and ensuring the Control Source property in the Property Sheet is completely blank.
Identify and Reset Check Boxes Using the Tag Property
Prevent assigning values to invalid or bound controls by explicitly filtering the intended check boxes using their Tag property before modifying them.
Iterating through all controls on a form and resetting them blindly often leads to assignment errors when the code hits a bound control or an unsupported object type. By utilizing the Tag property, you instruct VBA to only reset the specific unbound check boxes you have manually marked for this operation.
Open your Access form in Design View. Select all the unbound check boxes you want to reset. Open the Property Sheet (F4), navigate to the 'Other' tab, and type a specific identifier like 'ResetMe' in the Tag field.
Open the VBA editor for your form. Create or modify your reset subroutine to loop through the 'Me.Controls' collection.
Inside the loop, add an If statement to check if the control's Tag equals 'ResetMe'. If it matches, assign 'False' to the control's value.

Shift Control Focus Before Resetting
Sometimes, changing the value of a control that currently holds the cursor focus triggers assignment errors in Access.
Need a Free and Lightweight Office Suite? Try WPS Office
While WPS Office does not include a direct database alternative to Microsoft Access, it serves as a highly compatible, lightweight, and completely free alternative to Microsoft Word, Excel, and PowerPoint for your everyday document, spreadsheet, and presentation tasks.
- 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install the Suite: Run the setup file and follow the on-screen prompts to complete the quick installation process.
- 3. Open Your Office Files: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint files without worrying about formatting loss.

Frequently Asked Questions
Why does Microsoft Access say "You can't assign a value to this object"?
This error typically occurs if your VBA code tries to assign a value to a control that is bound to a calculated field, contains an expression in its Control Source property, or is locked against edits.
How do I check if my check box is bound or unbound?
Open the form in Design View, select the check box, and press F4 to open the Property Sheet. Check the Data tab; if the "Control Source" field is blank, the check box is unbound.
Is it safe to use 'On Error Resume Next' to bypass this error?
It is generally not recommended. Broad error suppression can hide other critical runtime errors. It is better practice to identify the correct controls using the Tag property or to handle specific error codes using a Select Case statement.




