I'm pretty new to Access (but been doing VBA in Excel for a little while now), and I have hit a snag. I may be trying to get Access VBA to do something it can't do, but not sure.
I have a form with a button on it. If the user presses the button, I want it to execute a sub in a module. My sub for when the user clicks on the button (the event) is located in the Class Object for that specific form. Here's the code from that sub inside "Form_MyForm" which is in 'Microsoft Access Class Objects'.
Private Sub Command20_Click()
... (some other code that doesn't refer to the Sub I want to call.)
Application.Run Module1.CreatePDFFiles
End Sub
The CreatePDFFiles sub is inside Module1.
When I click on the button and execute Sub Command20_Click, I get a compile error: Expected Function or variable. The part of the line below that is in bold is highlighted blue in my code window:
Application.Run Module1.CreatePDFFiles
I'm not sure what I'm doing wrong. Any ideas?