Auto Fill text box to text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I would like to be able to enter an ID# in one text box, and auto fill a
person's name in another text book. I would like this function to occur in
my database table and a form I created based off of this table. How does one
do this? My SQL knowledge is limited, but I am reading up on this.

Thanks,
Diana
PS--would it be easier if this function was auto fill from combo box to text
box?
 
Do you mean you have a Table tblPerson with Field names PersonID (PrimaryKey
or uniquely indexed) and PersonName and in a second Table tblOther, you want
to store both the related PersonID and PersonName?

If this is the case, I don't recommend storing the PersonName since knowing
the PersonID, you can always deduce the PersonName. Thus, in the tblOther,
you only need to store the PersonID.
 
Your advice makes sense. However, in my case, PersonName needs to be
displayed on tblOther (and its respective data-entry form) for quick
reference. I am hoping auto-fill will reduce the number of errors also in
entering wrong ID numbers. People can see right away if they entered the
wrong ID number, because the wrong name will auto-fill the next text box.
What is your suggestion for this sort of a problem? Is there a way to have
auto-fill and avoid redundancy? And if so, how do I make auto-fill work?

Thanks,
Diana
 
The normal practice to use a ComboBox showing the Person names for user to
select. However, the BoundColumn of the ComboBox is set to PersonID so that
only PersonID is stored in the tblOther (which is all you need) but the user
can select Person by name rather than some artificial PersonID which is
harder to remember.

Access even has the ComboBox Wizard that can create this comboBox for you.

There are a number of example of ComboBox usage in the sample database
NorthWind that comes with your Access software.
 

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

Back
Top