2 Replies - 489 Views - Last Post: 15 August 2012 - 07:08 PM Rate Topic: -----

#1 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

I get a syntax error on the 'If' line. what's wrong?

Posted 15 August 2012 - 04:16 AM

Private Sub frm03OK_Click()

     Dim wrkFSO As New Scripting.FileSystemObject
     dim wrkDrive as string
     
     wrkDrive = "F:"

     if wrkFSO.DriveExists wrkDrive then
        do some code
       else
        do some other code
     end if
 end sub


This post has been edited by AdamSpeight2008: 15 August 2012 - 02:47 PM
Reason for edit:: Fixing Code Tags

Is This A Good Question/Topic? 0
  • +

Replies To: I get a syntax error on the 'If' line. what's wrong?

#2 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,057
  • Joined: 17-July 10

Re: I get a syntax error on the 'If' line. what's wrong?

Posted 15 August 2012 - 04:18 AM

code tags are like [ code] [/ code]

To your code. The problem is that you don't use paranthesis
if wrkFSO.DriveExists(wrkDrive) then


This post has been edited by Ionut: 15 August 2012 - 04:19 AM

Was This Post Helpful? 1
  • +
  • -

#3 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: I get a syntax error on the 'If' line. what's wrong?

Posted 15 August 2012 - 07:08 PM

View PostIonut, on 15 August 2012 - 04:18 AM, said:

code tags are like [ code] [/ code]

To your code. The problem is that you don't use paranthesis
if wrkFSO.DriveExists(wrkDrive) then



Ionut,
Thanks for the help. Woked exactly correct!!
geoleob
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1