"Kevin Barnard" wrote
I'm building a simple flying logbook.
I have a table with the registrations of
all the aircraft I have flown and what
type of aircraft each is. I am now building
a form to input all my flying data into
another table. How is it possible for me to
input aircraft registration in one field and
have the aircraft type automatically placed
in another field?
As you already have the table of aircraft with registrations and type,
consider using a ComboBox based on a query that retrieves registration
and type into two columns. That way, you _choose_ the appropriate
registration, rather than having to enter a long and unintuitive
identification. Further, when you do, you can access the type by using
the Column property of the Combo Box. If aircraft type is in the
second column of the Combo, in the AfterUpdate of the Combo, this
code:
Me!txtType = Me!cboYourComboName.Column(1)
will set type into the TextBox on the Form that is named "txtType".
That said, the Table design you describe is "unnormalized" by
Relational Database design principles, and you may save yourself some
later effort if you'll only store the Registration and obtain the
Ttype by joining the tables on the Registration Field in a Query when
you need to use or display the information.
Larry Linson
Microsoft Access MVP