للتعرف علي المجلد الذي به القاعدة
يمكنك استخدام الكود التالي
Function GetPath(Name As String) As String
Dim i As Integer, pathtemp As String
i = 1
Do While i < Len(Name)
pathtemp = ""
Do While Mid(Name, i, 1) <> "\" And i <= Len(Name)
pathtemp = pathtemp & Mid(Name, i, 1)
i = i + 1
Loop
If Mid(Name, i, 1) = "\" Then
GetPath = GetPath & pathtemp & "\"
i = i + 1
End If
Loop
End Function
و لاستدعاؤه فى رسالة مثلا من الكود الخاص بالنقر علي زر :
Private Sub Command3_Click()
MsgBox GetPath(CurrentDb.Name)
End Sub