The code needs to be within the form for the Me. reference to work since Me refers to the active form. If your code is running in a standard module, you will need to reference the form field by its full name - Forms!YourForm!YourControl - or pass a reference to the control as an argument when you run the sub.
If that doesn't help, you'll need to post your code for people to look at.