Query needs to get data from selected item in combobox (1 Viewer)

jpl458

Well-known member
Local time
Yesterday, 20:57
Joined
Mar 30, 2012
Messages
1,038
I Have a combobox the has a list of companies (SelectCallcb). I have the following SQL:

Code:
SELECT Suspects.[First Name], Suspects.[Last Name], Suspects.Title, Suspects.Address, Suspects.Company, Suspects.CallCompany, Suspects.City, Suspects.zip, Mastertbl3.callingnumber, Mastertbl3.calldate, Mastertbl3.starttime, Mastertbl3.ActionableFlag
FROM Mastertbl3 INNER JOIN Suspects ON Mastertbl3.companyname1 = Suspects.CallCompany
WHERE (((Suspects.CallCompany)=[Enter Call Company])
ORDER BY Mastertbl3.calldate;

In the where clause, the term [Enter Call Company], needs to be replaced with the company name that was selected in the combobox. Still new at this, tried to find but no joy.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:57
Joined
May 7, 2009
Messages
19,245
try this:

SELECT Suspects.[First Name], ...
...
WHERE (((Suspects.CallCompany)=[Forms]![FormName]![CompanyComboName])
...
...
 

jpl458

Well-known member
Local time
Yesterday, 20:57
Joined
Mar 30, 2012
Messages
1,038
try this:

SELECT Suspects.[First Name], ...
...
WHERE (((Suspects.CallCompany)=[Forms]![FormName]![CompanyComboName])
...
...
Once I did the punctuation/special chars right, it worked great. Shoulda cut and pasted instead of eyeballing.

Thanks
 

Users who are viewing this thread

Top Bottom