themanof83
Registered User.
- Local time
- Today, 04:40
- Joined
- May 1, 2008
- Messages
- 73
Okay, I have been trying for a while now but am begining to get repeatingly lost and my code is up in the air at the minute!
Basically, I have an on-click command that uses the .FileSearch Property to locate specific files in a specific directory. This works perfectly.
If there is more then 1 file found within that directory then I have a form that opens with a listbox that I want to populate with the files found.
My problem is that I don't know how to pass the found files array (ArrFilesfound(i)) to the listbox in the other form. I would like this to happen in the Form_Open command of the form.
Here's the code from the on_click command:
It is ArrFilesfound(i) that I want the Form_Open function of my other form (Multiple) to pick up. Then populate the listbox with the values.
Thanks in advance.
Basically, I have an on-click command that uses the .FileSearch Property to locate specific files in a specific directory. This works perfectly.
If there is more then 1 file found within that directory then I have a form that opens with a listbox that I want to populate with the files found.
My problem is that I don't know how to pass the found files array (ArrFilesfound(i)) to the listbox in the other form. I would like this to happen in the Form_Open command of the form.
Here's the code from the on_click command:
Code:
'Execute the search....
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
If .FoundFiles.Count > 1 Then
FilesFoundCount = .FoundFiles.Count
For i = 1 To .FoundFiles.Count
ArrFilesfound(i) = .FoundFiles(i)
Debug.Print ArrFilesfound(i)
Next i
DoCmd.OpenForm "Multiple", acNormal, , , , acDialog
End If
End If
It is ArrFilesfound(i) that I want the Form_Open function of my other form (Multiple) to pick up. Then populate the listbox with the values.
Thanks in advance.