diff -up c:\autocomplete_widgets/autocomplete_widgets.admin.inc c:\xampp\htdocs\sites\all\modules\autocomplete_widgets/autocomplete_widgets.admin.inc

--- c:\autocomplete_widgets/autocomplete_widgets.admin.inc	2010-05-04 01:52:06.000000000 +1200
+++ c:\xampp\htdocs\sites\all\modules\autocomplete_widgets/autocomplete_widgets.admin.inc	2010-06-29 12:15:30.703125000 +1200
@@ -27,6 +27,9 @@ function _autocomplete_widgets_content_f
     else {
       // For the autocomplete 'field data' widget we do not use the 'Allowed values' list.
       unset($form['field']['allowed_values_fieldset']);
+      // Set default value to comply with original 'existing field data' functionality
+      $widget = &$form['widget'];
+      $widget['autocomplete_selected_field']['#default_value'] = isset($form['#field']['widget']['autocomplete_selected_field']) ? $form['#field']['widget']['autocomplete_selected_field'] : $form['#field']['field_name'];
     }
     // Disable the text processing option of text fields. These widgets can
     // only use plain text fields.
@@ -58,6 +61,23 @@ function _autocomplete_widgets_widget_se
         '#options' => array('starts_with' => t('Starts with'), 'contains' => t('Contains')),
         '#description' => t('Select the method used to collect autocomplete suggestions. Note that <em>Contains</em> can cause performance issues on sites with thousands of records.'),
       );
+      if ($widget['type'] == 'autocomplete_widgets_flddata') {
+	  module_load_include('inc', 'content', 'includes/content.admin');
+        $form['autocomplete_selected_field'] = array(
+          '#type' => 'select',
+          '#title' => t('Select exisiting field'),
+          '#default_value' => '',
+          '#options' => content_existing_field_options(),
+          '#description' => t('Select an existing field to lookup autocomplete suggestions from. Intended for use with text fields, other field types will probably not work.'),
+          '#required' => TRUE,
+        );
+      }
+      else {
+        $form['autocomplete_selected_field'] = array(
+          '#type' => 'value',
+          '#value' => 0,
+        );
+      }
       $form['autocomplete_case'] = array(
         '#type' => 'radios',
         '#title' => t('Case sensitive'),
@@ -110,6 +130,6 @@ function _autocomplete_widgets_widget_se
       return $form;
 
     case 'save':
-      return array('size', 'autocomplete_match', 'autocomplete_case', 'autocomplete_xss', 'i18n_flddata');
+      return array('size', 'autocomplete_match', 'autocomplete_selected_field', 'autocomplete_case', 'autocomplete_xss', 'i18n_flddata');
   }
 }
diff -up c:\autocomplete_widgets/autocomplete_widgets.common.inc c:\xampp\htdocs\sites\all\modules\autocomplete_widgets/autocomplete_widgets.common.inc
--- c:\autocomplete_widgets/autocomplete_widgets.common.inc	2010-05-04 01:52:06.000000000 +1200
+++ c:\xampp\htdocs\sites\all\modules\autocomplete_widgets/autocomplete_widgets.common.inc	2010-06-29 12:57:07.500000000 +1200
@@ -114,9 +114,10 @@ function _autocomplete_widgets_get_optio
  * Options are retrieved from existing values for the field.
  */
 function _autocomplete_widgets_get_options_flddata($field, $string = '', $match = 'contains', $keys = NULL, $limit = NULL) {
-  $db_info = content_database_info($field);
+  $lookup_field = isset($field['widget']['autocomplete_selected_field']) ? content_fields($field['widget']['autocomplete_selected_field']) : $field;
+  $db_info = content_database_info($lookup_field);
   $table = $db_info['table'];
-  $column = $field['field_name'] .'_'. key($db_info['columns']);
+  $column = $lookup_field['field_name'] .'_'. key($db_info['columns']);
   $where = array();
   $args = array();
 
Common subdirectories: c:\autocomplete_widgets/translations and c:\xampp\htdocs\sites\all\modules\autocomplete_widgets/translations
Common subdirectories: c:\autocomplete_widgets/views and c:\xampp\htdocs\sites\all\modules\autocomplete_widgets/views
