Im pregnant my partner is taking pain medication can it harm the baby?

Anything your partner does after you have already become pregnant will not affect your baby, unless they pass along an STD/STI -- your body closes the area the baby is in, off from the rest of the world to keep your child safe from contaminants, diseases, bacteria and the like.