G
greeknl via AccessMonster.com
I have two tables, contacts and companies, which are related by the companyID.
The value in the contacts tables is a result from the input form where for
avery contact one can choose the company using a combobox.
Now I would like to populate a list box using a query which as input uses
either the name (first or last) form one table or the company name from the
second table. (lets assume that in the contacts table a lot of names are the
same and that in the company table every record is unique)
I use the following query to limit the output to the selected values:
SELECT Contacts.ContactID,Contacts.LastName,Contacts.FirstName, Companies.
CompanyName FROM Companies INNER JOIN contacts ON Companies.
CompaniesID=contacts.CompanyID" & _
"where(((XXXXXX) like '*" & inputvalue & "*'))"
inputvalue is the value for the limitation of displayed data
XXXXXXX is the field to which the limitation is to be
The query gives no results (it works great when leaving out the comapnies bit)
I think something is wrong whit the innerjoin.
Please help
me I have almost ready a complete database and I would really like this to
work
The value in the contacts tables is a result from the input form where for
avery contact one can choose the company using a combobox.
Now I would like to populate a list box using a query which as input uses
either the name (first or last) form one table or the company name from the
second table. (lets assume that in the contacts table a lot of names are the
same and that in the company table every record is unique)
I use the following query to limit the output to the selected values:
SELECT Contacts.ContactID,Contacts.LastName,Contacts.FirstName, Companies.
CompanyName FROM Companies INNER JOIN contacts ON Companies.
CompaniesID=contacts.CompanyID" & _
"where(((XXXXXX) like '*" & inputvalue & "*'))"
inputvalue is the value for the limitation of displayed data
XXXXXXX is the field to which the limitation is to be
The query gives no results (it works great when leaving out the comapnies bit)
I think something is wrong whit the innerjoin.
Please help
me I have almost ready a complete database and I would really like this to
work