This might be the wrong forum although the acticex forum looks quiet.
I have an Access form on which there is a common dialogue control. I am trying to fill a list, eventually a table, with all the paths/documents names (.doc) from a selected directory. At the moment I can get one at a time, but its taking a long time to fill a list. Can the code be modified in any way, or anyone got other ideas. Many thanks
Private Sub Command5_Click()
Dim strFilter As String
Dim strInputFileName As String
'strFilter = ahtAddFilterItem(strFilter, "JPEG Files (*.jpg, *.jpeg)", "*.jpg;*.jpeg")
strFilter = ahtAddFilterItem(strFilter, "doc Files (*.doc)", "*.doc")
' strFilter = ahtAddFilterItem(strFilter, "all Files (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, _
OpenFile:=True, _
DialogTitle:="Choose a Transcription file...", _
Flags:=ahtOFN_HIDEREADONLY)
If Len(strInputFileName) > 0 Then
'MsgBox "You have just selected this Path: " & strInputFileName
Me.STOREDPATH.AddItem strInputFileName
Me.Command5.SetFocus
Command5_Click
Else
'No file chosen, or user canceled
End If
End Sub
I have an Access form on which there is a common dialogue control. I am trying to fill a list, eventually a table, with all the paths/documents names (.doc) from a selected directory. At the moment I can get one at a time, but its taking a long time to fill a list. Can the code be modified in any way, or anyone got other ideas. Many thanks
Private Sub Command5_Click()
Dim strFilter As String
Dim strInputFileName As String
'strFilter = ahtAddFilterItem(strFilter, "JPEG Files (*.jpg, *.jpeg)", "*.jpg;*.jpeg")
strFilter = ahtAddFilterItem(strFilter, "doc Files (*.doc)", "*.doc")
' strFilter = ahtAddFilterItem(strFilter, "all Files (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, _
OpenFile:=True, _
DialogTitle:="Choose a Transcription file...", _
Flags:=ahtOFN_HIDEREADONLY)
If Len(strInputFileName) > 0 Then
'MsgBox "You have just selected this Path: " & strInputFileName
Me.STOREDPATH.AddItem strInputFileName
Me.Command5.SetFocus
Command5_Click
Else
'No file chosen, or user canceled
End If
End Sub