var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Importing a filename into Access
I have managed to import data from an excel spreadsheet to the database, what I would also like to do is have the excel filename imported as well. Can anyone help me with this as I am really stuck on this one.
Thank you in advance
How are you importing the file and what do you want to do with the filename?
Post you code and I will modify it to meet you needs.
Sorry about that, I want to import the filename into a subform box called "Filename"
Strip the filename out -
' in : Full File Path
' out : File Name
' example : [subform box].txt = GetName("C:\ExcelFiles\SomeFile.xls")
Public Function GetName(strPath As String) As String
Dim lg As Long
On Error GoTo PROC_ERR
lg = Len(strPath)
lg = lg - 1
If lg = 0 Then Exit Do
Loop Until Mid(strPath, lg, 1) = "\" Or Mid(strPath, lg, 1) = ":"
GetName = Left(Mid(strPath, lg + 1), Len(Mid(strPath, lg + 1)) - 4)
MsgBox "Error: " & Err.Number & ". " & Err.Description, , _
thanks very much for your help. I can now successfully import the filename thanks to you.