Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / February 2007

Tip: Looking for answers? Try searching our database.

how to set a default path when you click on browse button?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sham_on_air - 28 Feb 2007 05:08 GMT
hi
i've made a database for temporary id cards,
to add photos i've made a command button - when i click on this button i
want it to take me to a specific folder where i store my photos!! please
help...
below given is the coding which i use for this button's on enter event..

Private Sub AddPicture_Enter()
   getFileName
End Sub

Sub getFileName()
   Dim fileName As String
   Dim result As Integer
   With Application.FileDialog(msoFileDialogFilePicker)
   
   
       .Title = "Select Employee Picture"
       .Filters.Add "All Files", "*.*"
       .Filters.Add "Bitmaps", "*.bmp"
       .Filters.Add "JPEGs", "*.jpg"
       .FilterIndex = 3
       .AllowMultiSelect = False
       .InitialFileName = CurrentProject.path
       
       
       result = .Show
       If (result <> 0) Then
           fileName = Trim(.SelectedItems.Item(1))
           Me![ImagePath].Visible = True
           Me![ImagePath].SetFocus
           Me![ImagePath].Text = fileName
       End If
   End With
End Sub
Damian S - 28 Feb 2007 07:36 GMT
Hi Sham_on_air,

Replace the following line:
.InitialFileName = CurrentProject.path

with one that points to the correct path (or picks the path up from a
settings table or similar) like this:

.InitialFileName = "c:\photos\"

Hope this helps.

Damian.

> hi
> i've made a database for temporary id cards,
[quoted text clipped - 31 lines]
>     End With
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.