need help with syntax

  • Thread starter Thread starter Paul
  • Start date Start date
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
 
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
 
Back
Top