
Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
Alright...I don't think my original question was complete. In the code you
supplied, it appears that I would need to enter the full path.
In my scenario, I will need the code to look in the specific folder and pull
the 3 numbers from the file name. Yes, it's always the 3 digits before the
extension.
>Always 3 digits in front of the file extension? Try:
>
[quoted text clipped - 5 lines]
>>
>> Thanks in advance!
Douglas J. Steele - 14 Sep 2006 00:31 GMT
Dim intNumber As Integer
Dim strPath As String
Dim strFile As String
strPath = "C:\Temp\"
strFile = Dir(strPath & "*.CHK)
If Len(strFile) > 0 Then
intNumber = Mid(strFilePath, InStrRev(strFile, ".") - 3, 3)
End If
That's assuming there's only one .CHK file you interested in in that folder.
If there are multiple, use:
Dim intNumber As Integer
Dim strPath As String
Dim strFile As String
strPath = "C:\Temp\"
strFile = Dir(strPath & "*.CHK)
Do While Len(strFile) > 0
intNumber = Mid(strFilePath, InStrRev(strFile, ".") - 3, 3)
strFile = Dir()
Loop

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Alright...I don't think my original question was complete. In the code
> you
[quoted text clipped - 15 lines]
>>>
>>> Thanks in advance!