Reference is Broken

I am trying to make and entry through a form, but if I try to enter the reference field programmatically, I get “Reference Field is Broken.” I need the form to make an entry with a prespecified reference field. How do I do this?