Automatic field filling

B

Brian Monk

How do I set up a form that automatically fills certain fields once one piece
of related information is inputted? An example would be from a table with an
ID number and first name and last name fields, I want to fill a form for
another table and expect to just type in the id number and get the computer
to automatically fill in the other fields
 
S

Steve Schapel

Brian

The general principle, in the example you gave, is that the second table
should not have first name and last name fields in it at all. Apologies
if you already understand this, but it is not clear from your post what
you intend. When you enter the second table's ID number via the form,
you have identified the individual, and know the first name and last
name by reference to the first table, so it is redundant to store this
again in the second table. However, the requirement to have the first
name and last name displayed on the second form is something that often
arises. There are a number of approaches to this, one of which is to
make your second form based on a query which includes both tables,
joined on the ID field. That means you can include the first name and
last name fields form the first table directly into the query, and hence
onto the second form. When the ID is entered on the form, the names
will automatically be shown. In this case, it would probably be
appropriate to set the Enabled property of the first name and last name
controls on the form to No, and their Locked prooerty to Yes, as this is
probably not the place to allow editing of the name data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top