تفضل أخي الكريم
وانت عليك التعديل حسب أسم الحقل عندك في النموزج
Dim ofn As OPENFILENAME
ofn.lStructSize = Len(ofn)
ofn.lpstrFilter = "Mdb Files (*.mdb)" + Chr$(0) + "*.mdb" + Chr$(0) + "Mde Files "
ofn.lpstrFile = Space$(254)
ofn.nMaxFile = 255
ofn.lpstrFileTitle = Space$(254)
ofn.nMaxFileTitle = 255
ofn.lpstrInitialDir = CurDir
ofn.lpstrTitle = " Berwas "
ofn.flags = 0
Dim A
A = GetOpenFileName(ofn)
If (A) Then
MsgBox Left$(Trim$(ofn.lpstrFile), InStrRev(Trim$(ofn.lpstrFile), "\"))
Else
MsgBox "Cancel was pressed"
End If
Exit Sub
CmdBrowseErrHandler:
If Err.Number = 32755 Then
MsgBox " You did not change the file name ", 64, "Alert Message "
ElseIf Err.Number = 20477 Then
MsgBox " Invalid file name ", 16, "Alert Message "
Else
MsgBox Str(Err.Number) + Err.Description
End If
Exit Sub
تحياتي