It would be difficult to lay out the full code here, but we do something similar, so let me try to point you in the right direction.
What you are looking for is normally referred to as "jQuery Autocomplete". A great example can be found here:
Or use jQuery along with jQuery UI with this:
The first plugin will get you most of the way there, but it does require some jQuery & PHP experience.
The way it works is as follows:
- install the jQuery plugin on your server
- modify the included PHP file to include a database call based on your criteria. The query would follow the logic, "Select all fields, for entries in the Company Channel, where the Custom ID field is equal to the ID passed from the search"
- the above query and settings depend on your setup, and which jQuery plugin you use.
- you add the jQuery Autocomplete code to the one specific 'search' field in your Freeform
- when you have that working, typing in an ID will start autocompleting existing entries. You can specify in the PHP settings file which field to display in the result box.
- Clicking on a result would then reload the page, passing the results as POST variables
- you could then use the POST variable, the company ID for example, within your main channel or Freeform tags as a parameter
- PHP knowledge needed to setup the PHP code
- MySQL skills needed to build the query (very basic though)
- You must be careful regarding customer security & privacy. Are you certain that you want to make public all of the "Company" data?
Check out the link above though, to assess how comfortable you are with this type of script. If not, it is somewhat trivial for an experienced developer.
Feel free to reach out for help here if needed.