-
this is somewhat a newbie question...
i am writting a small app for a client that requires the following..
when the app starts for the first time
it should ask the user to give path to the db (using a dialog box)
when the user finds the database throu dialog boxes
it should store FULL path into a variable i guess..
and then i can use that variable to know where db is
any help would be greatly appreciated
than am gonna write that to a INI file and i can play around with it from there..
thanks
*newbie to this dialog thing, please dont get to technical*
-
give this a whirl
add a common dialog control to your first form
Code:
Private Sub FindDB()
Dim dbLocation As String
On Error GoTo Open_Error
With CommonDialog1
.DialogTitle = "Find database"
.CancelError = True
.Flags = cdlOFNFileMustExist
.InitDir = App.Path
.Filter = "Microsoft Access Database |*.mdb"
.ShowOpen
dbLocation = .FileName
End With
Exit Sub
Open_Error:
Select Case Err.Number
Case 1
Exit Sub
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical
End Select
End Sub
You might have to change a few things around to fit your program, but that is the basics of it.
-
lalal
'slaps himself HARD'
worked like a charm
thanks
hehe the only thing i coudnt figure out was weather .filename gives full path or just filename
but now i know :)