471,853 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

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

Hello,

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 816
Seth Schrock
2,965 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
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.