need help with syntax

P

Paul

I'm using the following code to test for the existence of a folder on one of
our network drives, but I'm getting a syntax error on the last line below:

Dim filesys As Object
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FolderExists("M:\Leasing-And-Design\Jobs\" & Me!cboAgency & "\" &
Me!City & "\" & Me!Address") Then . . .

I suspect I need to do something about the quotation marks around the two
backslashes, but I'm not sure what. The reason I'm so sure is that the
expression works fine if test for something that doesn't require
concatenation. For example,

If filesys.FolderExists("M:\Leasing-And-Design\Jobs"") Then . . .

works just fine, without any syntax error. How can I modify the syntax to
remove the error?

Thanks in advance,

Paul
 
P

Paul

Well, I just figured out that the problem was that last double quotes in

& Me!Address")

The error went away after I changed it to

& Me!Address)

Thanks for taking a look at this.

Paul
 

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

Top