Fix an Access VBA Compile Error on a Control's Visible Property
Question details
Resolve a VBA compile error involving a form control's Visible property in Microsoft Access.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A form uses VBA to change a control's visibility in its Load or Before Update event.
- Observed behavior
- Access reports “Method or data member not found”; a control name mismatch, an unsupported property, or another compile error may be responsible.
Open the affected Access database and identify the form and event code that reference the control. You will need access to the form's Design View and the VBA editor.
Check the control name and compile the form's VBA code
Use this approach when Access reports “Method or data member not found” for a form control reference.
In the Navigation Pane, right-click the form and select Design View. Select the control, open the Property Sheet, and check its Name property on the Other tab.
Open the form's code in the VBA editor and compare the reference with the Name property. For example, change Me.Machine_Name if the control has a different name; for a name containing a space, use a reference such as Me![Machine Name].
In Design View, confirm which control is selected and review references to its properties in the VBA editor. Check any expression such as Me.Machine_Name.ListIndex and make sure the referenced control supports that property.
In the VBA editor, select Debug > Compile, followed by the project name. Correct the first highlighted error, then compile again until no further errors are reported.
Open the form in Form View and repeat the actions that trigger its Load and Before Update events. Confirm that the control's Visible property behaves as intended.
Use WPS Office for Compatible Documents and Spreadsheets
WPS Office is a free, lightweight Office alternative with a familiar interface for working with documents, spreadsheets, and presentations. It supports common Microsoft Office formats for easier migration, but it does not fix Access VBA errors or run Access forms.

Frequently Asked Questions
How do I find a control's actual name in Access?
Open the form in Design View, select the control, and check the Name property on the Property Sheet's Other tab. Use that name in the VBA reference.
Can a different VBA error cause the compile message?
Yes. In the VBA editor, choose Debug > Compile and fix the first reported error. Repeat until the project compiles without further errors.
What should I check if ListIndex is highlighted?
Check that the reference points to the intended control and that its control type supports ListIndex. Correct the reference or use an appropriate property for that control.
Can WPS Office fix an Access VBA compile error?
No. Correct and compile the VBA code in Microsoft Access. WPS Office is an alternative for common document, spreadsheet, and presentation files, not for running Access forms.




