Just starting out an need help with Lookup (1 Viewer)

Dhinton

New member
Local time
Today, 06:29
Joined
Aug 19, 2023
Messages
2
Hi all

Im trying to build a knowledge database for my job and thought it would be good to try and develop this using Access.

I have two tables so far - Companies and Contacts. I want to create a contact and select the company using a dropdown. Once the dropdown has been chosen is there any way of populating a field on the contacts table with the Company ID number?

Thanks and sorry if this is a simple one I think this is the first time I have opened Access.

Thanks
Daniel
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:29
Joined
Sep 21, 2011
Messages
14,299
I would bring in the CompanyID and CompanyName into your combo.
First field for me is always the ID field and hidden. Then other fields as needed.
Then if your field in the contacts table is bound to the combo, it is automaticall set?

I do something similar in this diabetes db.
I select a food and the carbs,sugar and fibre are also in the combo, just not visisble.

1692530747070.png
 

Dhinton

New member
Local time
Today, 06:29
Joined
Aug 19, 2023
Messages
2
I would bring in the CompanyID and CompanyName into your combo.
First field for me is always the ID field and hidden. Then other fields as needed.
Then if your field in the contacts table is bound to the combo, it is automaticall set?

I do something similar in this diabetes db.
I select a food and the carbs,sugar and fibre are also in the combo, just not visisble.

View attachment 109511
Thank you, Gasman,

I think if I understand right that's what I need but how do I create a combo?

I have attached what I have done so far (not much) the idea is for a user to create a contact and associate it with the company then the company form will also bring up all associated contacts.

Thanks for your help much appreciated.

Thanks

Daniel
 

Attachments

  • Knowledge Matrix.accdb
    1.3 MB · Views: 61

Mike Krailo

Well-known member
Local time
Today, 01:29
Joined
Mar 28, 2020
Messages
1,044
I'm guessing what your really trying to do is create a sub form of contacts per company. I have created two new forms frmCompany and sfrmContacts and placed the sub form on the company form.
 

Attachments

  • KnowledgeMatrix_V2.zip
    91.2 KB · Views: 67

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:29
Joined
Oct 29, 2018
Messages
21,473
Hi Daniel. Welcome to AWF!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:29
Joined
Feb 19, 2002
Messages
43,275
If you are converting existing data, you are probably starting with just a contacts table and you need to add company to the contact. In most applications, any given contact would only ever be associated with more than a single company.

However, once you convert the existing data, the perspective changes. Going forward, to add a new contact, you would open the company table first and then use a subform to add the new contact. This will be the best way to ensure not adding the same contact multiple times. Contact will NOT stand alone in in the new application. Although, you will may need a search form that will allow you to find the company a contact is associated with if someone called and you didn't get their company name.
 

Users who are viewing this thread

Top Bottom