Need Help with autopost in Form Field

Hey Lucy

Registered User.
Local time
Today, 12:15
Joined
Jan 20, 2012
Messages
124
I am developing a Customers/Orders database for a client.

Some of the customers will be companies with a contact name. Some will be individual customers.

So---in the Customers table I have a field for Company, Contact, and Customer.

In the Orders table, Company, Contact and Customer is looked up from a query based on the Customer ID.

I have an Order form created for the orders to be input into.

What I need is when the Company is input for it to automatically post the contact name in the Contact field. The Company field is a drop-down for the person entering to choose from, as is the Customer field.

How can I get the Order form to automatically post the Contact based on the Company?

Thanks for your help!
 
Can you post a print screen with the relationships ?
 
Thanks for your response. I have included two screenshots. These two are for looking up the Company (from Customers table) in the Orders table. One shows the actual query, the other the parameters for same.

The Customer field is looked up the same way and the screenshots would be exactly the same except being tied to the Order via the Customer Field.

I hope this makes sense.

Right now, the Contact is also set up this way, but I think that does not need to be a look up in the table. I am just not sure how to tie the Contact to the Company so when a Company is selected on the Order form it will automatically post that Company's Contact Name into the Contact field.
 

Attachments

  • Company Lookup.jpg
    Company Lookup.jpg
    95.4 KB · Views: 126
  • Company Query.jpg
    Company Query.jpg
    94.5 KB · Views: 121
I have asked for the database relationship window.
 
Sorry, Gotcha Will post.

While that will be interesting to see, and potentially useful. it might also not be necessary. From what you have revealed so far, it looks like you can handle your request with some behind the scenes VB Code.

If I understand correctly, the Company Dropdown is based on a Query that obtains both the Customer name and the Company name, and displays the Company name.

If that is the case, then Column(0) of the Dropdown contains the Customer name, and Column(1) contains the Company name. in the On Change Event for the Company Dropdown, you can define the Customer name to be the value contained in Column(0).

-- Rookie
 
For some reason, my relationship window does not show any relationships. (Yes, I have added all objects to the relationship window, so I don't know what's going on. I think I have the issue worked out though. Thanks for trying to help me!
 

Users who are viewing this thread

Back
Top Bottom