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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wheelerk
    New Member
    • Jan 2016
    • 1

    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.
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    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
    Code:
    Forms![I]form_name[/I]![I]control_name[/I]

    Comment

    Working...