Fix an Access 365 Command Button That Won’t Open a Form
Question details
Restore an Access command button that should open a report criteria form after migration to Access 365.

- Product
- Microsoft Access 365
- Device & OS
- not provided
- Scenario
- A command button uses the lstReports list box to pass a value to the frmRptCritB report criteria form.
- Observed behavior
- Clicking the command button produces no response after the database is migrated to Access 365.
Open the database in Access and confirm that the form frmRptCritB and the list box lstReports still exist. Review the button’s existing On Click code before replacing it, so you can retain any other required actions.
Recreate the command button’s On Click event
Use this method when the button’s event procedure is missing, disconnected, or no longer runs after migration.
Open the form containing the command button in Design View, select the button, and open the Property Sheet.
On the Event tab, set On Click to [Event Procedure]. Click the Build button (...) beside the property and choose Code Builder if prompted.
In the button’s generated Click procedure, add this line between Private Sub and End Sub: DoCmd.OpenForm "frmRptCritB", OpenArgs:=Me.lstReports.Column(0)
In the VBA editor, choose Debug > Compile, resolve any reported errors, and save. Return to Form View, select a report in lstReports, and click the button.

Check database trust and VBA compilation
Use these checks if the event is configured correctly but the button still does nothing.
Use WPS Office for documents, spreadsheets, and presentations
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility for easier migration of everyday files. It does not repair or run Access database forms and VBA events.

Frequently Asked Questions
Why does my Access command button do nothing when clicked?
The On Click property may not point to an event procedure, or Access may be blocking VBA in an untrusted database. Check the button’s Property Sheet > Event tab and any security warning shown when the database opens.
How do I pass the selected list box value to the form?
In the button’s Click procedure, use DoCmd.OpenForm "frmRptCritB", OpenArgs:=Me.lstReports.Column(0). Select an item first and ensure the destination form expects the first column’s value in OpenArgs.
Where can I check whether the VBA code compiles?
Press Alt+F11 in Access to open the VBA editor, then choose Debug > Compile. Resolve any errors reported before testing the button again.
Can WPS Office fix an Access command button?
No. The button, form, and VBA event must be repaired in Microsoft Access. WPS Office can be used separately for compatible documents, spreadsheets, and presentations.




