My car won't stop beeping

I have a 1990 Honda Civic I've had it for 4 years. First some background info on the beeping. When you turn the car off and leave the key in the ignition the car beeps and won't stop until you take the key out of the ignition. It's a simple 4 quick beeps about one second long occurring every other second. I assume it's a feature that prevents you from leaving your keys in the ignition. Cool makes sense. Ok so here s the problem. About 4 months ago it started doing that same beeping but not when the car was off and the key was left in the ignition but when I was driving. It would beep a few times then stop. It was a very occasional thing. Over the next 3 months the beeping happened more frequently and stayed beeping longer and finally about a month ago the beeping started every time I turn the car on and continues until I turn it off and remove the key. Over this month I've just turned the music up loud enough to mask the beeps but it's a really loud annoying beep. I just want it to stop. Today while trying to figure out how to stop the beeping I discovered that if I open the driver door it stops. If the car is off and the key is in the ignition and beeping if I open the door the beeps stop but as soon as I close it they start again. Same with if the car is in accessory mode beeping away if I open the driver door suddenly the beeps stop but as soon as the door closes they start up again. Same if the car is running.

Check the door close switch. It will be somewhere on the door jamb. Move/press it and see if the dome light turns off an on. If this is broken then that can cause problems.
Check the wiring in the door harness.