Given a database object in MS Access VBA, how can one get that database's VBProject?
Function GetVBProject(ByVal db As Database) As VBProject
Set GetVBProject = ???
End Function
The only way I know how to get VBProjects in Access is through Application.VBE.VBProjects.Item(???)
. However, I won't know what order of the projects are in and what the name is. I will only know it's parent database. The equivalent in Excel would be simply
Function GetVBProject(ByVal wb As Workbook) As VBProject
Set GetVBProject = wb.VBProject
End Function