There is a cable that goes from the shifter down to the transmission itself. It may need adjusting and the transmission may not know you actually want "D" and it's thinking you want "3." To access one of the plugs for the transmission fluid, you need to get a wrench into a tight space that the shifting lever restricts access to, so if you've had the fluid messed with, it may have been loosened or damged somehow. I do not know how to adjust this, or if it is 'adjustable,' but it's a start. If I remember correctly, it's shaft next to the fluid fill hole is covered by a red boot and should be easy to spot.
Check that out, then make sure there is enough fluid, that's a given. It's a PITA just to *CHECK*, so you might as well drop the sumps and change the filter/fluid while you got the car in the air. Besides, this way you can check for excessive metal shavings on the sump magnet and if that isn't your problem, at lest you have the peace of mind that you have fresh fluid, filter, and know that your gears havn't been completely converted to powder. A filter & gasket kit from pelican parts is quite cheap.
Other than that, I say tranny control computer since you don't describe any illegular shiffting patterns from normal (AKA slipping, hard shifts, illregular engaging, etc. - other than it wont select 4th gear) - but if all of that crap is not the case, then yes, there is a mechanical problem in the transmission and it's time for a swap.
If you slam on the brakes really hard, and then get back onto the accelerator and it seems like the transmission went into neutral and without warning SLAMS back into gear, spinning the tires - you have a low fluid level. This is not a good test, but um, if it happens then it's an indicator of that.