Drop down to populate data to subform

riekie

New member
Local time
Today, 19:01
Joined
Dec 15, 2013
Messages
5
Hi,

I have:
Tables: Customer and Orders

Relationship: Customer ID is the primary key in Customer and is a foreign key in order table.

I need to create a Form with contains all the customer info from the customer table, as a drop down list. Once the customer is selected, all their orders should appear in a subform.

At the minute I can get a form to work which shows all the orders but you have to go to the next record so see the order. For example it will say John smith and one order. The next record will be John smith again and their second order in the sub from.

I have used access in the past and I am fine with creating everything apart from the drop down. I am just a bit lost with the structure.

Thanks
 
If I understand you correctly, your SQL statement for the RowSource of your Combobox needs to include DISTINCT, so, instead of reading something like

Code:
SELECT [CustomerID], [CustomerName]
FROM CustomerTabel
it'd be something like this
Code:
SELECT [COLOR="Red"]DISTINCT[/COLOR] [CustomerID], [CustomerName]
FROM CustomerTabel
Linq ;0)>
 
Thank you for the response. The form is generated by a query that selects distinct customers and this is in my sql. My form works a lot better now, for each customer it will show their orders.

However I do not understand the combo box part. The form reads like this:

Form:
Title
Surname
Customer ID

Sub Form:
Order ID
Order details
Customer ID

I would like to change the customer part of the form to a drop down:
Mr John Smith 001
Miss Kate Smith 002
 

Users who are viewing this thread

Back
Top Bottom