Trial and Error is a 1997 American romantic comedy film about an attorney and his friendly actor, who takes his place in court to defend the bosss hopelessly guilty relative. It stars Michael Richards, Jeff Daniels and Charlize Theron.
During the celebration, Charlie is knocked out in a barfight, and is later prescribed painkillers for the resulting pain. The next day the day of the court appearance Richard checks on his friend and finds Charlie has taken all of the pills in the bottle. Charlie winds up in no shape to appear in court that day, as legal counsel for conartist Benny Gibbs Rip Torn, so Richard impersonates Charlie. When the case unexpectedly goes to trial, Richard and Charlie must continue the charade, or they both will go to prison for perpetrating and conspiring to perpetrate a fraud upon the court.Charlie coaches Richard as to the use of the rules of evidence, masquerading as Richards assistant, surreptitiously using flash cards to tell Richard which basis for objection to use. Charlie eventually loses it and screams at the judge, Austin Pendleton trying to overrule Charlie, when Richard disobeys Charlie and takes the defense in a broader direction, and Charlie is banned from reentering the courthouse. Later, Richard and Charlie devise a communication system involving a baby monitor and morsecode sounding of Charlies vehicles horn, heard through an open window, to instruct Richard as to which type of objection to use. ........
Source: Wikipedia