Somewhere beneath the fart jokes and the libidinous-dog jokes and the general Sandlerism of “Click” lies a movie with a good heart and an uplifting message. And that movie is called “It’s a Wonderful Life.”

This is the second time (after “Mr. Deeds”) that Adam Sandler & Co. have pillaged a Frank Capra film for their purposes. Capra is fondly remembered for making proudly old-fashioned all-American comedies and moral, patriotic dramas. How Sandler came to inherit that mantle today — thus becoming the 21st century equivalent of Jimmy Stewart — I don’t know. Maybe it’s a coincidence that “Mr. Deeds” and “Click” are both Capra remakes, especially since “Click” isn’t even credited as one.

What I do know is that “Click” starts out as a lowbrow slob comedy with jokes that don’t exactly work and a premise that doesn’t exactly make sense and morphs into a Very Special Episode of a syrupy TV sitcom. It eventually abandons all attempts at comedy and for a full half-hour seeks to elicit sympathy for the plight of its main character. That it aaaaaalmost pulls it off is a startling achievement indeed.

Sandler plays Michael Newman, a workaholic architect who, as is custom with movie dads, neglects his hot wife Donna (Kate Beckinsale) and his two little kids Ben (Joseph Castanon) and Samantha (Tatum McCann). His boss (David Hasselhoff, now officially his generation’s William Shatner) makes demands and Michael complies, regardless of his prior commitments. He even misses young Ben’s (school play? Parent-teacher conference? Piano recital? No, but close) swim meet.

Unlike 100 percent of real-life young American fathers, Michael can’t figure out how to work his TV’s remote control — seriously, isn’t remote prowess what guys are famous for? — and keeps accidentally opening his garage door instead. (Why is the garage door opener on the living room coffee table?) So he goes in search of a universal remote and stumbles into the back room at Bed, Bath & Beyond, where an odd mad-scientist-looking man named Morty (Christopher Walken) gives him a universal remote control that remotely controls Michael’s universe. Hitting “fast-forward” skips through an argument with his wife. He can turn down the volume on his dog’s barking. Bored with rush-hour traffic? Just skip to the next “chapter” and suddenly you’re at work!

The film, written by “Bruce Almighty” scribes Steve Koren and Mark O’Keefe, goes through the obvious permutations here. Michael has a special fondness for freeze-framing people and doing physical harm to them while they stand motionless; that is how he is able to release a mighty burst of flatulence directly in his boss’ face.

But soon Michael realizes he’s fast-fowarding through so many “boring” parts of his life that he’s missing the good parts that happen in between. And then the remote, which learns his habits and adapts to his preferences, starts fast-forwarding automatically — a weekend, a year, 10 years, and so forth.

Why, if Michael can skip ahead a few chapters, he can’t also skip BACK a few chapters if he fears he’s gone too far is not explained.

The director, Frank Coraci (also of Sandler’s “The Waterboy” and “The Wedding Singer”), has his hands full with the change in tone, and I doubt he’ll please all of Sandler’s fans. The people who think a dog humping a stuffed animal is funny surely will not be impressed with the existential “I should have stopped to smell the roses” angst of the second half, while those who appreciate the genuinely good old-age makeup and futuristic set designs in the last act probably won’t have laughed much in the first 45 minutes. (You get three guesses which category I fall into.)

The comedy is weak and the tugs at the heartstrings are only slightly stronger. The good news? The obligatory Rob Schneider cameo has him in disguise as an Arabian prince, so you might not even recognize him! Really, you thank heaven for small favors.

Random note: In a flashback to 1976, Michael sees himself as a kid asking his friends over to watch “Three’s Company.” It’s no wonder they decline, though, since the show didn’t premiere until 1977.

C (1 hr., 38 min.; PG-13, a lot of profanity, some sexuality, a fair amount of crude humor.)