Alhakeem1977
Registered User.
- Local time
- Tomorrow, 01:00
- Joined
- Jun 24, 2017
- Messages
- 308
How can I get the file names of a folder on my desktop called 'Target': "C:\Users\Basel\Desktop\Target" in a ListBox1 on MS Access form called Form1?
I succeed to get the pdf files in a web browser control, but I prefer to have them as a text in my list box1 and can open them from the Listbox and can move them to another folder instead.
I have the below code but I am not getting any result:
Your earliest response would be highly appreciated.
I succeed to get the pdf files in a web browser control, but I prefer to have them as a text in my list box1 and can open them from the Listbox and can move them to another folder instead.
I have the below code but I am not getting any result:
Code:
Private Sub UserForm_initialize()
Dim Filename As String
Dim Form1 As Form
Filename = Dir("C:\Users\Basel\Desktop\Target" & "\*.pdf", vbNormal)
Do While Len(Filename) > 0
Form1.ListBox1.AddItem Filename
Filename = Dir()
Loop
End Sub
Your earliest response would be highly appreciated.