I have an Access 2000 format database that contains the VBA code
OtherContract = DLookup("[Contract Code]", "TimeSheets", "[Contract Code] <> [frmqryTimeSheets]![Contract Code] AND [Payroll Number] = [frmqryTimeSheets]![Payroll Number] AND [Worked Week No] = [frmqryTimeSheets]![Worked Week No] AND [Sun] > 0 ")
When the database is accessed with Access 2007 I get a run time error 2766 and the message "The object doesn't contain the automation object frmqryTimesheets". The same code run from a machine running Office XP works perfectly, and it has previously worked perfectly from the Office 2007 machines. I am not aware of any changes that have been made to the PCs involved.
Can anyone explain why this is happening? Many thanks in advance.