Query based input types?

Query based input types?

I am trying to create an edit page (not using edit record widget due to complexity). In this page, I have a TableRecords that is generated from a query that lists all availible fields (kind of like a form) that can be set for this particular subject. The problem comes when I want to add the inputs to allow users to input the data for me to later write to the form tables for this individual. Some of the fields are text input, some are drop down, some are radio button list, and some are checkbox list. I have access to the type of field it is (stored in the query generating the TableRecords). Is there any way for me to use that information to control what type of input I put next to the label for each item?

For instance, if the query tells me this field is a text input, then I want to present a text input to the user. If the query tells me this field is a drop down, then I want to present the user with a drop down (I have access to the values to populate the drop down also). If the query shows it as a Radio button list, I want to present them with the same, and so on. 

Anyone have any ideas on how to pull this off?

Details if needed:
All availible field info is stored in a particular table (let's say Table1), but must be filtered down by a query to only show specific fields availible.

All user provided inputs will be stored in a different table (let's say Table2) that only stores field id from Table1, and selected values from user inputs. 
Hi Guy, 

in order to help you out let us have more context on the challenge you have there. 

Are you starting an app from the scratch and implementing that way or are you connecting to a legacy system that already have that datamodel and "flexibility" for design in runtime?

Can I assume, based on your words, that you would like to have some sort of "form/survey engine" build on top of your data model and all information you have ther?