My car is 19 years old?

I have a 1999 Honda accord that has a lot of kilometres on it. Its very reliable for most part because I maintain it. However, I have hard time passing the emission test because the check engine light keeps coming back on. I always have to spend mine on repairs to clear it so I can pass the emission test.

Now this Gas gauge, pedometer and the display to show the mileage stopped working. I still drive it for now but I know these things will make it fail for emission test

I got approve for line of credit for my bank for $41,000 so I could get a brand-new car even if I wanted to. Will this car just become a money pit? Time to move on?

Added (1). I have to add that I'm not buying a 41k car. I might spend 10 or 15 k on a newer car

Your 1999 Honda won't be anywhere near the money pit that a 41k car will be. Go pay cash for a 20k car so you aren't paying interest and also inflated rates for tabs and insurance in addition to the monthly payment.

Buy that 41k car and it will cost you more than 60k over the next five years to own. You're not spending anywhere near that on your Honda.

Won't flunk emissions for that stuff. Safety maybe. You get to chose how long you want to drive a car with nuisance things going wrong with it.

"Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks."

― Warren Buffett

If possible in the UK, have a rebuilt engine + transmissions installed… That way the veehicle will pass the MOT

If you change the air filter and change the oil to fully synthetic you should get cleaner emissions. Fit new spark plugs too if they are old and make sure the engine is to full working temperature immediately prior to the test. At least a ten mile drive before should help.

AT this point it's time to think about replacing it.

Depends some on where you are, what kind of inspection required- this in UK or California? Locally a car that old would be exempt from odometer reading and most pollution tests except in Milwaukee and couple other counties next to the pollution alert area. Basic airfilter, oil change and clean sparkplugs or new 'hot' plugs with a warmed up engine, cleaned cat will get you through a test lane that does actual tailpipe check, maybe not the OBD2 or 3 computer check diagnostics machine--and about 1/2 the time the states that do the computer scan check have the alternate tailpipe wand as a alternative at certain locations. There are some specialty mechanics shops that will do some retuning, occasional chip changing before emission tests, some other shops. In some areas that will tell you they can pay a bit extra to get stickers from corrupt tester that would 'fudge' results and some in old like Chicago would take you to state test lane, asked for the one tester and slip him $50.00 for completed 'passed' form without taking test or even have vehicle there. VolksWagon diesels had a program subroutine that would change injection pulse timing when connected to to diagnostic computer in some markets - pass pollution test drive away and after 2 start/stop cycle without computer port plug would reset to dirty running, power performance mode. Check local salvage yard and speed shops for pollution test services, computer reflashing test devices--cheating to keep running services.