Supraracer
New member
- Local time
- Today, 06:01
- Joined
- Feb 24, 2009
- Messages
- 6
I have a table named Quote_Info. Within is a field named Customer_ID (which looks up the Customer_Name from the Customer_Info table). There is als a Contact_ID field which would look up the Contact_ID from the Customer_Contact table. Each customer can have several contacts.
This is what I am trying to do.
In the Quote_Info Datasheet I click a combo box to select the Customer Name (stores the ID not the name but this works fine) and based on this the Contact Name combo box should only display the contact names of that customer when the down arrow is clicked. I either get all the customers contacts or none in my attempts.
I choose Smith Contracting then go to Contact name and click down arrow. Only the Contacts from Smith contracting should show up here but I will get all or none.
Is the current SQL but it will prompt me for the info rather than pull it from the form / datasheet I am using. I am new to all of this but do have some basic understanding of programming. I don't know if this will have to be done in VBA because the querrie runs when the sheet is opened and not when changed?
Thank you for your time.
John
This is what I am trying to do.
In the Quote_Info Datasheet I click a combo box to select the Customer Name (stores the ID not the name but this works fine) and based on this the Contact Name combo box should only display the contact names of that customer when the down arrow is clicked. I either get all the customers contacts or none in my attempts.
I choose Smith Contracting then go to Contact name and click down arrow. Only the Contacts from Smith contracting should show up here but I will get all or none.
Code:
SELECT Customer_Contact.Contact_ID, Customer_Contact.Last_Name, Customer_Contact.First_Name, FROM Customer_Contact WHERE Customer_Contact.Customer_ID = [Quote_Info].[Customer_ID] ORDER BY Customer_Contact.Last_Name;
Is the current SQL but it will prompt me for the info rather than pull it from the form / datasheet I am using. I am new to all of this but do have some basic understanding of programming. I don't know if this will have to be done in VBA because the querrie runs when the sheet is opened and not when changed?
Thank you for your time.
John