I have a function "ParseFileName" which removes the ".txt" in the file name which is stored in the variable varItem:
Expand|Select|Wrap|Line Numbers
- Public Function ParseFileName(varItem As String) As String
- x = InStrRev(varItem, "\")
- sFile = Mid(varItem, x + 1)
- sFile = Left(sFile, Len(sFile) - 4)
- ParseFileName = sFile
- End Function
When using this line of code:
Expand|Select|Wrap|Line Numbers
- sFile = ParseFileName(CStr(varItem))
- CurrentDb.Execute "UPDATE TableData SET BananaField = " & sFile & " WHERE BananaField Is Null;"
I have been googling trying to seek the answer without success.
sFile is after calling the function ParseFileName = 0000024-D00 as expected.
How do i store this String variable sFile in the table? How do i use a string in the currentdb.execute command?
Thank you