I'm trying to pass a variable back from a function and it is not working. I know that I'm forgetting something, but I have confused myself.
sub tryingtofind()
counters = FileFinder(GetFiles)
Counter = CInt(counters)
If Counter <> 0 Then
CaptionValue = 2
StatusCaptionCase (CaptionValue)
'lblStatus.Caption = StatusCaption
'move the files from the input directory to the correct subfolder
'of the directory to store the files
result = MoveFiles
ActionValue = result
If ActionValue = 3 Or ActionValue = 4 Then
CaptionValue = 3
Else
CaptionValue = 0
End If
'write to the lstReport what was done
'example "Moved file from here to there
ActionCase (ActionValue)
lstReport.AddItem Action
'write to the lstFile the file name that was moved
'example "NF-XYZ-000-1234"
lstFile.AddItem FileName
End If
end sub
Public Function FileFinder(WatchDir As String) As String
Dim FileFinding As String
Dim count As Integer
Dim counts As String
count = 0
FileFinding = Dir(WatchDir) 'Where to look for.
Do Until FileFinding = ""
count = count + 1
FileFinding = Dir
Loop
counts = CStr(count)
'FileFinder counts
End Function
