I have a func proc as follows:
Private Function GetContainingFile(ByVal dirTemp As Directory, ByVal dtDateAndTime As Date) As String ...... End Function
I have a command button on a form that when clicked the following code (in part) executes
Private Sub cmdFindFiles_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFindFiles.Click Dim dirTemp As Directory Dim fsiTemp As FileSystemInfo Dim dtMaxDateAndTime As Date Dim strFileStartDateAndTime As String Dim strFileEndDateAndTime As String Dim strCritDateAsStr As String Dim lngTimePeriodAsSecs As Long 'code to check values entered on form ....... 'didn't like this code (value of type string cannot be converted to System.IO>Directory) dirTemp = Me.txtSearchFolder.Text 'so I tried this dirTemp.SetCurrentDirectory(Me.txtSearchFolder.Text) 'then follows the main part where the func proc is called 'get the name of the containing file as a string based upon the criteria specified on the form strFileStartDateAndTime = GetContainingFile(dirTemp, Me.dtpChooseDate.Value) ........ End Sub
unfortunately, dirTemp is returning a value of "Nothing", so the call to the func proc doesn't work
So, has anybody got any ideas what the mistake is?
Kind regards and merry Christmas