Fix Syntax Errors and Unavailable Functions in Microsoft Access Forms and Queries
Question details
The user needs to identify and resolve syntax errors or unavailable functions while creating Microsoft Access database objects.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Creating or configuring forms, queries, command buttons, and other database objects.
- Observed behavior
- Access reports a syntax error or indicates that a required function is unavailable.
Note the exact error message and the action that triggers it, such as opening a form, running a query, or clicking a button. Identify the affected object in the Navigation Pane so you can inspect its design, expressions, and event code.
Check the form's record source and the underlying query
Use this check when an error appears while opening a form or displaying its records.
In the Navigation Pane, right-click the affected form and select Design View. Press F4 to open the Property Sheet, select Form in its selection list, and check Data > Record Source. For a form intended to display records, verify that the named table or query exists.
If Record Source names a saved query, open that query directly from the Navigation Pane. If it contains an SQL statement, click the build button (...) beside Record Source to inspect it in the query builder, then switch to SQL View to review the statement.
Open the affected query in Design View or SQL View and inspect the expression associated with the error. Check field names, quotation marks around text, parentheses, and function arguments. Save the correction, run the query again, and reopen the form.

Compile the form's VBA code and check missing references
Use this approach when Access highlights VBA code or reports that a function cannot be found.
Use a command button to run a query from a form
Use this method when the goal is to launch a saved query from a form rather than treat the query as a form control.
Use WPS Office to Work With Data Exported From Access
WPS Office is a free, lightweight alternative for everyday document and spreadsheet work, with a familiar interface and Microsoft Office format compatibility that makes migration straightforward. It does not repair Access databases or run Access VBA, but WPS Spreadsheet can help you analyze data exported from Access to Excel format.

Frequently Asked Questions
Does an empty Record Source cause an Access form error?
Not necessarily. In Design View, check Property Sheet > Data > Record Source. A form that displays database records needs a valid source, but an unbound navigation form or button panel may not need one.
Why does Access say a function is unavailable even though the code looks correct?
A missing library reference or an inaccessible custom function can cause this. Open the Visual Basic Editor and check Tools > References for MISSING entries. For a custom function called by a query, verify that it is Public and located in a standard module.
Can I add a query directly to an Access form as a control?
No. To run a query, add a command button in Design View and configure its On Click event. To display the query's records, assign it as the Record Source of a form or subform.
What information should I provide if these checks do not fix the error?
Provide the exact error text, the affected form or query name, and the action that triggers it. Include the relevant SQL expression or VBA statement and mention any MISSING entries under Tools > References.
Can WPS Office open an Access database and fix its VBA errors?
No. WPS Office is not a replacement for the Access database engine and does not run Access forms or VBA. For spreadsheet analysis, export a table or query through Access's External Data > Excel option, then open the exported workbook in WPS Spreadsheet.




