C.B.
Hi J.. Well, I am sure my advice is not going to be what you want to hear, but here goes anyway...
What is your boyfriend doing sleeping over at your house in the first place?? I'm just wondering if that is going to be ok when your children grow up and become sexual - because, of course, that is what you are teaching them by your example.
Our children learn who to be in the world through our behavior. So your daughter (and son) are learning that it is totally ok to just sleep with someone when she feels like it! You see, she won't get or understand your excuses for it - she'll just emulate it...
So my first advice is to be who you want her to be. And, of course, don't be upset with her when she does what you do. It will be what she was taught from the very beginning.
Otherwise, your daughter is communicating with you loud and clear and you are not listening, nor are you hearing her. She is just way too young to have a strange man come and go in her life. When your boyfriend comes and goes - on his, adult, schedule, a child doesn't get that he has a life.
She gets that another man is doing what daddy did. Leaving.
The very best thing you can do is to not mix your sex life with your job as a mother. DO NOT allow your boyfriend to stay over, and don't act sexual in any way around your daughter. She already knows her Dad left and she has had not choice in who replaces him. That is a nightmare for a child to begin with. Don't complicate it.
After she gets through this traumatic time and you are remarried in a committed, strong, loving relationship that will be another story.
In the meantime, either she sleeps with you to comfort you and make bed time/night time easier for you (which it really should not be about...), or you work on keeping her in her own bed all night.
Doing that is simply a matter of... doing it. Do not allow her in your bed. Do not allow her to pop in and out of bed. You have your bed - in which you sleep alone, and she has her bed, in which she sleeps alone.
Be kind, be sweet, be loving - but don't let her get out of her bed. And don't you get in. Rub her back, sing to her, rub her head or feet. But she stays in bed.
If she gets up, put her back. Gently and lovingly. If she is secure in your love for her, she will be able to sleep soundly in her own space.
If she is not - if there is a usurper in her Mom's bed, this will not work.
She is your number one priority right now and for at least the next 18 years - this is not about you.