Your @DbLookup
gets the database's path from second column under key "DatabaseReferencePMWOHist" in view "AdminKeys" in your current database.
So, the only thing you have to do, is to go into view "AdminKeys", search for key "DatabaseReferencePMWOHist", open the document and change value from "Engineering\PMWorkOrderMgmtHist.nsf" to "aApplications\PMWorkOrderMgmt.nsf".
Your code should work without any changes - only a setting in a document is wrong.