Hello,
I have a function "ParseFileN ame" which removes the ".txt" in the file name which is stored in the variable varItem:
I want to use this function to call it so that the remaining part of the file name is stored into my table. So if the filename is 000024-D00.txt from the beginning, i want 0000024-D00 to be stored into the table.
When using this line of code:
I get error 'too few parameters, expected 1'.
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.execu te command?
Thank you
I have a function "ParseFileN ame" which removes the ".txt" in the file name which is stored in the variable varItem:
Code:
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:
Code:
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.execu te command?
Thank you
Comment