Unless your doctor has told you that you are a high-risk pregnancy and need to refrain from having sex, you can go right ahead and have sex up until when your water breaks (or if and when it starts to get too uncomfortable for you) ↑
Having sex will not do any harm...that is unless you doctor has said to avoid it. I'm currenlty 36 weeks pregnant and still having sex. It does at times feel a bit uncomfortable with the round ligament pain and occassionaly there is a bit of cramping afterwards. I just stop if it's painful...it should never be painful. ↑