469,138 Members | 1,297 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,138 developers. It's quick & easy.

Filtering in a drop down box and automatically reference a company from previous form


Very new to access and am having a few issues with my database if anyone could help it would be appreciated. Its a contact database and set up in the following way:

I have a table for company information with details such as registered address, telephone numbers etc.

Then I have a contact table which has a list of contact information such as name email address etc.

I want the contacts to be linked to the company, the way it is set up at the moment is I have a company form which allows you to add new companies or edit existing companies. on this form there is a button which opens up a contact form. At the moment on the form is a box for company name this is set as a drop down box but you can start typing the company name in. I have 2 questions regarding this box:

1) can I set it so this box automatically references the company from which the form opened up from for example if I have just added or edited a company called "test123" when I click the button to add new contact the company "test123" is already set as the company to which I want to link the contact information to.

2) if I cant do the above I can select the company from the drop down box however the drop down box doesn't appear to be showing the full list of companies. for example if I have 2 companies 1 called "Example Belgium" and the other is called "Example UK Ltd" when I scroll down the list it only shows "example Belgium" if I start typing in the box (which starts to filter the list and I type "example U" it then shows "example UK Ltd" so it is obviously in the list I just cant work out why it isn't showing in the first instance.

As I mentioned I'm new to access to tried to ask the question in basic terms so I can understand but if I've left something out or you need more information please ask.

Any help would be greatly appreciated.
Jan 21 '16 #1
1 783
Seth Schrock
2,957 Expert 2GB
In your contacts form's OnLoad event, set the value of your Company combo box to the value on your other form. To get the value from a control on another form, the syntax is
Expand|Select|Wrap|Line Numbers
  1. Forms!form_name!control_name
Jan 22 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Ben | last post: by
5 posts views Thread by Vigneshwar Pilli via DotNetMonster.com | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.