I want to get all the folder names and match them to records in our db. If a customer's name has a comma in it it throws it to the next line in the list box and deletes the Comma as well.
Example:
ABC Company
DEG Enterprizes
Inc
Therro Company
Greg tharow
Lastoe Company
Inc
So it should DEG Enterprizes, Inc
and Lastoe Company, Inc
Here is code
DougP
< I Built one
Example:
ABC Company
DEG Enterprizes
Inc
Therro Company
Greg tharow
Lastoe Company
Inc
So it should DEG Enterprizes, Inc
and Lastoe Company, Inc
Here is code
Code:
MyPath = "f:\CLIENT ADMIN TAMPA 2007\" ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to make sure MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
Me.List2.AddItem MyName ' Display entry
End If ' it represents a directory.
End If
MyName = Dir ' Get next entry.
Loop
DougP
< I Built one