LibObject




Dim Db As DAO.DataBase
Dim rs As DAO.Recordset
'This way, VBA knows what library to look in for the definition of DBEngine

'(the top object). If you don't do this, VBA surfs the references collections to find it.

'You can also use the word VBA in front of functions (Left$, Mid$, MsgBox, and so on)

'and write the subroutine or function like this:

Public Sub MsgBox ()
VBA.Msgbox "The new way to use VBA :-)", vbInformation + _
vbOkonly, "VBPJ TechTip Section"
End Sub

Private Sub Form_Load()
'Call the MsgBox Sub

MsgBox
End Sub

I always put the word DAO in front of all references to
DAO objects. Here are some examples:










( libobject.html )- by Paolo Puglisi - Modifica del 17/12/2023