Combo box question

T

tcorlew

I am in the first stages of setting up our new database. I am good at
figuring out how to tweek the old one but starting from scratch is puzzling
me.

I have only gotten as far as setting up the records in a table. What I am
wanting to do is make a drop down list in the jobs menu that only pulls up
the salepersons for that particular company.

I have tried going into lookup, selecting combo box, and then making an SQL
statement.
SELECT SalesPersons.Salesperson, Customers.CustomerID FROM Customers INNER
JOIN SalesPersons ON Customers.CustomerID = SalesPersons.CustomerID;

but this brings up all the salesperson for all companies. Can you tell me
what I am doing wrong.
 
T

tcorlew

I am sorry I am an idiot when it comes to this. I don't understand what you
want me to do. I took it as copying and pasting that to the end of what I
already have....that did not work.

KARL DEWEY said:
Add --
WHERE SalesPersons.Salesperson = [Forms]![YourForm]![YourComboBox]

tcorlew said:
I am in the first stages of setting up our new database. I am good at
figuring out how to tweek the old one but starting from scratch is puzzling
me.

I have only gotten as far as setting up the records in a table. What I am
wanting to do is make a drop down list in the jobs menu that only pulls up
the salepersons for that particular company.

I have tried going into lookup, selecting combo box, and then making an SQL
statement.
SELECT SalesPersons.Salesperson, Customers.CustomerID FROM Customers INNER
JOIN SalesPersons ON Customers.CustomerID = SalesPersons.CustomerID;

but this brings up all the salesperson for all companies. Can you tell me
what I am doing wrong.
 
K

KARL DEWEY

The syntax for SQL statement is to end with a semicolon. Remove the
semicolon that ended your SQL, paste, and add a semicolon to the end.

tcorlew said:
I am sorry I am an idiot when it comes to this. I don't understand what you
want me to do. I took it as copying and pasting that to the end of what I
already have....that did not work.

KARL DEWEY said:
Add --
WHERE SalesPersons.Salesperson = [Forms]![YourForm]![YourComboBox]

tcorlew said:
I am in the first stages of setting up our new database. I am good at
figuring out how to tweek the old one but starting from scratch is puzzling
me.

I have only gotten as far as setting up the records in a table. What I am
wanting to do is make a drop down list in the jobs menu that only pulls up
the salepersons for that particular company.

I have tried going into lookup, selecting combo box, and then making an SQL
statement.
SELECT SalesPersons.Salesperson, Customers.CustomerID FROM Customers INNER
JOIN SalesPersons ON Customers.CustomerID = SalesPersons.CustomerID;

but this brings up all the salesperson for all companies. Can you tell me
what I am doing wrong.
 
Top