Autocomplete - updating 2 or more fields

I want to use autocomplete (text_field_with_auto_complete) to update
several field s if a match is found. I.e. a user types something in the
autocomplete field, a match is found, the application then goes and
fetches some more values from the database and populates some fields on
the form based on the match found. Has anybody done anything like this?
Any advice very much appreciated. Many thanks.