[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

How can I auto fill fields based on another fields data?

Posted on 2008-02-06
3
Medium Priority
?
2,830 Views
Last Modified: 2012-08-13
I am creating a database that will be used as a company contact list.  I am going to be using the following tables and fields:

Table: Contact
1.  ID
2.  Last Name
3.  First Name
4.  Phone Number
5.  Extension
6.  Email
7.  Branch

Table: Branch
1.  Branch
2.  Phone Number

I would like to use field7(Branch) as a lookup into Table: Branch and  would like field4(Phone Number) to auto fill with field2(Phone Number) from Table: Branch.

Thanks in advance for any help.
0
Comment
Question by:datalink944
3 Comments
 
LVL 48

Expert Comment

by:Jorge Paulino
ID: 20837460
Add a combobox and follow the wizard. You can select the branch and insert the phone number in the appropriated field (contact table)
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 20837494
You can't do this at the table level. You can use the LookUp tab in the Table design screen to provide a list of values that are possible from the other table. But in order to default, wouldn't you need criteria to say that if branch = branch then  put this value in my field, else do something else?

You can of course use an on_load event on a form to populate a field based on that logic, but you didn't mention a form.

??
J
0
 
LVL 14

Accepted Solution

by:
ldunscombe earned 1500 total points
ID: 20837510
Theroetically in a normalised database you shouldn't need to.  I would suggest a slightly different structure as follows with a one-to-many relationship between the two tables on Branch_ID.

Table: Contact
1.  Contact_ID <Key Index No Duplicates>
2.  Branch_ID   <Index Allow Duplicates>
3.  Last_Name
4.  First_Name
5.  Phone_Number
6.  Extension
7.  Email


Table: Branch
1.  Branch_ID <Key Index No Duplicates>
2.  Branch
3.  Phone_Number

Leigh
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Audit trails are very important in any system to hold people responsible for certain transactions and hold them to take ownership of their actions. This article is dedicated to all novice "Microsoft Access" developers.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question