ma2k,
In 2000, you can use the Microsoft CommonDialog1 combined with a button control.
You add the CommonDialog1 control to your form and then reference it in your code via a button OnClick event.
Note: the CommonDialog1 control is only there to be referenced, when you runtime the form, it disappears.
Also, disregard the public call to LinkTables.
Here is a sample of one, short and sweet:
Private Sub cmdFindDB_Click()
'OnClick event for a button control
'Refences a CommonDialog1 control, named CommonDialog1
Dim intTrimLen As Integer
Dim intFullLen As Integer
Dim strPath As String
Dim strDB As String
CommonDialog1.InitDir = "\"
CommonDialog1.Filter = "Millennium Client Database (*.mdb)|*.mdb|All Files (*.*)|*.*"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
intTrimLen = Len(CommonDialog1.FileTitle)
intFullLen = Len(CommonDialog1.FileName)
strPath = Left(CommonDialog1.FileName, intFullLen - intTrimLen)
Me!DatabasePath.SetFocus
Me!DatabasePath.Text = CommonDialog1.FileName
strDB = CommonDialog1.FileName
Else: Exit Sub
End If
LinkTables (strDB)
End Sub