I have this code which checks various things but at the final ElseIf does not work... so... a part of the code...
strTodaysDate = Format(Now(), "yyyymmdd"
& ".zip"
DestZipCheck = frmMain.txtFolderDes(1).Text & "\strTodaysDate"
msg = "You have already backed up the files today at the destination drive specified. Do you want to overwrite this file with the new backup?"
btn = vbYesNo + vbQuestion
If DestinationDrive = "" Then
n = MsgBox("You did not enter the destination drive... please enter the destination drive.", vbExclamation, "No Destination Drive"
ElseIf DriveReady(DestinationDrive) = False Then
n = MsgBox("The Destination drive was unavailable... please select a suitable drive or insert the backup media.", vbExclamation, "Destination Drive Unavailable"
ElseIf LocationDrive = "" Then
n = MsgBox("You did not enter the Location drive... please enter the location drive.", vbExclamation, "No Location Drive"
ElseIf f.FileExists(LocationXtrain) = False Then
n = MsgBox("The Xtrain.mdb could not be found at the location that you specified.", vbExclamation, "No Xtrain.mdb"
'************************
' this is the problem bit below
'************************
ElseIf f.FileExists(LocationUser) = False Then
n = MsgBox("The User.mdb could not be found at the location that you specified.", vbExclamation, "No User.mdb"
ElseIf f.FileExists(DestZipCheck) = True Then
n = MsgBox(msg, btn, "File Has Been Backed Up Today"
If n = vbYes Then Kill (DestZipCheck)
Call CreateBackup
Else
Call CreateBackup
End If
End Sub
... I cannot check to see if the file exists even though it is in the right folder etc. It just calls the other procedure and ignores the vbyesno bit...
Any help would be much appreciated...
Thanks everyone
strTodaysDate = Format(Now(), "yyyymmdd"
DestZipCheck = frmMain.txtFolderDes(1).Text & "\strTodaysDate"
msg = "You have already backed up the files today at the destination drive specified. Do you want to overwrite this file with the new backup?"
btn = vbYesNo + vbQuestion
If DestinationDrive = "" Then
n = MsgBox("You did not enter the destination drive... please enter the destination drive.", vbExclamation, "No Destination Drive"
ElseIf DriveReady(DestinationDrive) = False Then
n = MsgBox("The Destination drive was unavailable... please select a suitable drive or insert the backup media.", vbExclamation, "Destination Drive Unavailable"
ElseIf LocationDrive = "" Then
n = MsgBox("You did not enter the Location drive... please enter the location drive.", vbExclamation, "No Location Drive"
ElseIf f.FileExists(LocationXtrain) = False Then
n = MsgBox("The Xtrain.mdb could not be found at the location that you specified.", vbExclamation, "No Xtrain.mdb"
'************************
' this is the problem bit below
'************************
ElseIf f.FileExists(LocationUser) = False Then
n = MsgBox("The User.mdb could not be found at the location that you specified.", vbExclamation, "No User.mdb"
ElseIf f.FileExists(DestZipCheck) = True Then
n = MsgBox(msg, btn, "File Has Been Backed Up Today"
If n = vbYes Then Kill (DestZipCheck)
Call CreateBackup
Else
Call CreateBackup
End If
End Sub
... I cannot check to see if the file exists even though it is in the right folder etc. It just calls the other procedure and ignores the vbyesno bit...
Any help would be much appreciated...
Thanks everyone