How do I make a listbox on a form to list all recommended customers?
The form, named "Customer Form", is based on a simple table named "Customers" with
the fields ID,Name,Recommended_by. The field "Recommended_by" has the datatype
Long Integer and just stores another custromers ID number.
On the Form is a listbox in which I want to display all customers (name only) that has been
recommended by the customer that is presently beeing displayed in the
form.
I set the listbox's rowsource to:
SELECT Customer.ID,
Customer.Name, Customer.Recommended_by
FROM Customers
WHERE
Customers.Recommended_by=[Forms]![Custumer Form]![ID];
But this doesent work! The listbox get empty!
If I put a textbox in the form and just write =[Forms]![Custumer Form]![ID]; it shows the ID so theres nothing wrong
with anything else it seems. Also if I change the "[Forms]![Custumer Form]![ID]" to an ID number, lets say 1141, it shows all customers with ths ID numer in the field Recommended_by.
Whats wrong?
|
|