Question : Using modules in Access 2007

My form can see the mdo module.  Why can't it see the DoRecs function?

Private Sub btnGo_Click()
    Dim mdo As Module
   
    Set mdo = Application.Modules("DORecord")
    Result = mdo.DORecs(txtStudyID, txtDate, txtDOType)


End Sub

Answer : Using modules in Access 2007

That's not really the correct way to call a function or sub in a module. Assuming you've not made the function/sub Private, and assuming the name is not duplicated in another sub/function, all you do is this:

Result = DoRecs(txStudyID, txtDate, txtDoType)
Random Solutions  
 
programming4us programming4us