Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for File to Append

Status
Not open for further replies.

khosseini

Programmer
Sep 14, 2006
18
0
0
US
I would like the program to look for a specific file on the C: and if there to append it. I have tested the appending portion of the code and all is well there. However when writing the if-then portion of code I am getting errors when trying to step through, this is the troublesome bit of code:

If "C:\GROUP1" = True Then

I am sure there is something I am missing or not doing right here. If this file is there, then append it, if not skip it and move on to the next file. I have 10 files the code will be looking for and moving through.

Thanks!
 
If Dir("C:\GROUP1") <> "" Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Have a look at the FileSystemObjects and the FileExist method there.

Quick search of the web for examples here


Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
If Dir("C:\GROUP1") <> "" Then

I added this code and was give the:

"Identifier under cursor is not recognized" and the cursor is set right after the >

Thanks though.
 
I looked at the website given by abaldwin, and thought this bit of code would be helpful as I was trying to see if the file existed before I tried loading it into the database:

If fso.FileExists("C:\GROUP1") Then

I got the same "identifier under cursor is not recognized" and it is next to the )

Thoughts?

Thanks!
Kendra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top