Scenario:
The record source of Datasheet uses "SELECT * FROM .... " rather than explicitly specifying the required fields.
The form design adds controls for a subset of fields.
Some of the field names contain spaces.
Problem:
A syntax error occurs if the user attempts to do in-form filtering on any of the columns relating to fields containing spaces.
Solution:
In design mode, open the property sheet for the affected controls. Select the data tab and put square brackets [] round the Control Source.
Comment:
Yes - field names with spaces is bad practice. However, the form design is tolerant to it but fails if you want to use filtering.
Access has been around for a long time yet there are still wrinkles like this.
It is suggested that the design code automatically detects spaces and adds the brackets. This needs to be implemented when using the form wizard or the property sheet.