Didn't see anyone answer this, so here's a shot at it.

For one, you should probably remove the Exit Function but that shouldn't be
throwing an error.

Can you tell us what line it is failing on?

HTH,
Toby

----- Original Message ----- 
From: "bitschon" <[EMAIL PROTECTED]>
To: <AccessDevelopers@yahoogroups.com>
Sent: Monday, June 27, 2005 5:14 PM
Subject: [AccessDevelopers] Fill a list box with file names


> I am trying to fill a list box with file names
>
> I am using this code:
>
> Function fill_lb()
> ChDir ("H:\Accounting\_nick_s\proj_240\010_Input")
>
> mypath = "H:\Accounting\_nick_s\proj_240\010_Input\"
>
> myname = Dir(mypath, vbNormal)    ' Retrieve the first entry.
>
> MsgBox myname
>
> List12.AddItem myname
> Exit Function
>
> 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(myname)) = vbNormal Then
>             MsgBox "my name " & myname
>             List12.AddItem (myname)           ' Display entry only if
> it
>         End If                            ' it represents a directory.
>     End If
>
>     myname = Dir  ' Get next entry.
> Loop
>
> End Function
>
> But I get a run time error, Problem referencing a method
>
> How is this done?
>
> THanks John
>
>
>
>
>
>
>
> Please zip all files prior to uploading to Files section.
> Yahoo! Groups Links
>
>
>
>
>
>




Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to