Import .csv files from directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I've pasted the codes from http://allenbrowne.com/ser-59.html into a module
and created a form with a listbox. In the on Open event of the form I have
the following code:

Private Sub Form_Open(Cancel As Integer)

Call ListFiles("g:\user\contracts\Data_files", "*.csv", ,
Me.lstFileList)

End Sub


However, I am getting a datatype mismatch error. Can someone tell me why?

Also, the example says to place the above code in the On Load event but the
sub is for the On Open event. Which is it?

Thanks!
 
What version of Access are you using? Have you compiled the code? If so does
it give and error message - I know in A2k you get error on AddItem which
needs ' out and prevents the listbox listing option.

TonyT..
 
Which line goves you the data type mismatch error?

Does the code compile (Compile on Debug menu, in code window)?

Is there an issue with references:
http://allenbrowne.com/ser-38.html

Have corrected the example so it uses the Load event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top