Relative file references

前端 未结 3 1390
深忆病人
深忆病人 2021-01-12 17:02

In have built a couple of mda library files which I am then referencing from my main Access application (i.e. using Tools -> References from within the IDE).

Is ther

3条回答
  •  清酒与你
    2021-01-12 18:09

    You can add VBA references through VBA itself.

    Dim sFilename As String
    sFilename = CurrentProject.Path & "\" & whatever.mda
    
    Application.References.AddFromFile sFilename
    

    Just put that in your AutoExec and that reference ought to be available for everything. Of course, you'll have to check if the reference already exists before adding it, otherwise you get an error. But that's just a matter of looping through Application.References.

提交回复
热议问题