List of choice from an other table in a field of the form

How to create a form where a field of a table A is a list of name from an other table B.
when create the new entrie into the table A, register the Foreign key of the table B choice.