J
Jon
Greeting,
I have the following code for uploading the image path into my table, it is
working fine if the images are store in one folder(main) but that problem now
I have subfolders under the main folder and access could not open the image
because the path is not completed.
Private Sub Command32_Click()
Dim fileName As String
Dim arrFileName() As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Item Picture"
.Filters.Add "All Files", "*.*"
.Filters.Add "JPEGs", "*.jpg"
.Filters.Add "Bitmaps", "*.bmp"
.FilterIndex = 2
.AllowMultiSelect = False
.InitialFileName = CurrentProject.Path
result = .Show
If (result <> 0) Then
arrFileName() = Split(.SelectedItems.Item(1), "\", -1)
fileName = "\" + arrFileName(UBound(arrFileName) - 1) + "\" +
arrFileName(UBound(arrFileName)) + "\" + arrFileName(UBound(arrFileName))
Me![Image path].Visible = True
Me![Image path].SetFocus
Me![Image path].Text = fileName
End If
End With
End Sub
I beleve that the problem is one this line because it does not up load the
mainfolder\subfolder\image.bmp.
arrFileName() = Split(.SelectedItems.Item(1), "\", -1)
fileName = "\" + arrFileName(UBound(arrFileName) - 1) + "\" +
arrFileName(UBound(arrFileName)) + "\" + arrFileName(UBound(arrFileName))
any help please??
I have the following code for uploading the image path into my table, it is
working fine if the images are store in one folder(main) but that problem now
I have subfolders under the main folder and access could not open the image
because the path is not completed.
Private Sub Command32_Click()
Dim fileName As String
Dim arrFileName() As String
Dim result As Integer
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select Item Picture"
.Filters.Add "All Files", "*.*"
.Filters.Add "JPEGs", "*.jpg"
.Filters.Add "Bitmaps", "*.bmp"
.FilterIndex = 2
.AllowMultiSelect = False
.InitialFileName = CurrentProject.Path
result = .Show
If (result <> 0) Then
arrFileName() = Split(.SelectedItems.Item(1), "\", -1)
fileName = "\" + arrFileName(UBound(arrFileName) - 1) + "\" +
arrFileName(UBound(arrFileName)) + "\" + arrFileName(UBound(arrFileName))
Me![Image path].Visible = True
Me![Image path].SetFocus
Me![Image path].Text = fileName
End If
End With
End Sub
I beleve that the problem is one this line because it does not up load the
mainfolder\subfolder\image.bmp.
arrFileName() = Split(.SelectedItems.Item(1), "\", -1)
fileName = "\" + arrFileName(UBound(arrFileName) - 1) + "\" +
arrFileName(UBound(arrFileName)) + "\" + arrFileName(UBound(arrFileName))
any help please??