Public Sub renameFile(byVal oldName as String, byVal newName as String)
Dim blDoRename as Boolean, strPassword as String
blDoRename = True ' Default value to True
' If oldName contains ".accdr" and newName contains ".accdb"
If (instr(Lcase(oldName), ".accdr") > 0) AND (instr(Lcase(newName), ".accdb") > 0)
strPassword = InputBox("Input the password to complete the task")
' blDoRename is True if strPassword is correct else it is False
blDoRename = (strPassword = "yourPassword")
Endif
' Only do rename if blDoRename is True
if blDoRename = True Then Name oldName AS newName
End Sub