Hi Everyone!
I have a listbox name txtfilename in my form and I have this code hoping to display all my PDF files in my listbox in a Form
and I have an error as below
Private Sub Form_Load()
Dim sPath As String Dim sFile As String
sPath = "C:\TESTFILE"
sFile = Dir(sPath & "*.pdf")
Do While sFile <> vbNullString
If sFile <> "." And sFile <> ".." Then
'Me.txtfilename.AddItem sFile <<<<<----------- it highlights here = Compile Error : Method or Data member not found
End If
sFile = Dir
Loop
Exit Sub
End Sub
Can anyone is kind to help on how to figure out the error??
Thanks in advance.
Rev12