Creating a field that has node values using FAPI
If it is for a custom module, Drupal makes it quite easy to do an autocomplete field.

See a tutorial here... http://timonweb.com/posts/how-to-create-an-ajax-autocomplete-textfield-in-drupal-7/ 

You would then do a validation function to determine whether the entity exists, or you would only provide a list of existing entities in the first place.

If you are using the core fields, then try the entity reference module.