R
rich
Hello Everyone,
I am having a problem using combo boxes and queries. Here are the details:
LkTbl_Company: 2nd column has two possible values (Company 1 or 2)
CompanyID AutoNumber Primary Key
CompanyName Text
LkTbl_Role_Master: This table describes various roles for each company.
RoleID AutoNumber Primary Key
CompanyName Text
RoleName Text
Currently, there is no relationship between the two tables. Not sure if I
need to re-link the tables or not. Not successful when the link was
previously there.
On my form, I have two combo boxes. The first, cboCompany successfully
allows the user to select either of the two possible companies.
The second combo box, (cboEmployeeRole) (this is the problem box) should
display the various roles that apply to either company. After the company is
selected in the first combo box, the second box should display the results of
the following query:
Select Lktbl_Role_Master.CompanyName from Lktbl_Role_Master
Where Lktbl_Role_Master.CompanyName = Form.cboEmployeeRole.
If I execute the query directly, I am prompted for the company and the
correct results are displayed. However, when executed from within the form,
nothing appears in the combobox. It appears that the query runs and the
values are retrieved, just not displayed. If you click the dropdown, it
appears that the box expands with enough space for the results. Company 1
has about 8 values to return, company 2 has 2 values to return. The dropdown
expands to accomodate the number of values.
I'd appreciate any help.
Thanks in advance,
Rich
I am having a problem using combo boxes and queries. Here are the details:
LkTbl_Company: 2nd column has two possible values (Company 1 or 2)
CompanyID AutoNumber Primary Key
CompanyName Text
LkTbl_Role_Master: This table describes various roles for each company.
RoleID AutoNumber Primary Key
CompanyName Text
RoleName Text
Currently, there is no relationship between the two tables. Not sure if I
need to re-link the tables or not. Not successful when the link was
previously there.
On my form, I have two combo boxes. The first, cboCompany successfully
allows the user to select either of the two possible companies.
The second combo box, (cboEmployeeRole) (this is the problem box) should
display the various roles that apply to either company. After the company is
selected in the first combo box, the second box should display the results of
the following query:
Select Lktbl_Role_Master.CompanyName from Lktbl_Role_Master
Where Lktbl_Role_Master.CompanyName = Form.cboEmployeeRole.
If I execute the query directly, I am prompted for the company and the
correct results are displayed. However, when executed from within the form,
nothing appears in the combobox. It appears that the query runs and the
values are retrieved, just not displayed. If you click the dropdown, it
appears that the box expands with enough space for the results. Company 1
has about 8 values to return, company 2 has 2 values to return. The dropdown
expands to accomodate the number of values.
I'd appreciate any help.
Thanks in advance,
Rich