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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Else If Problems

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
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
 
It's alright now thanks folks.... problem solved ;o)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top