Basing 2 combo boxes on another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there - i have a company form that allows users to enter, amongst other
things, 2 project numbers against a company so e.g. company joe bloggs might
have project numbers 35 and 40 assigned against it.

I then have an activity form where users log information such as hours
worked with a company and they must also select a project number here - i
have no problem limiting the value in the project number field to the first
project field from the company form based on the company that the user
selects e.g. if company joe bloggs has project number 35 assigned to the
first project field and 40 assigned to the second proejct field then on the
activity form when selecting company joe bloggs the project field will only
allow you to select 35 - however i would like it to show BOTH 35 and 40 as
available for selection but am unsure of how to modify the rowsource query to
allow for this?

Can anyone help?

Thanks,
 
Rhys said:
Hi there - i have a company form that allows users to enter, amongst other
things, 2 project numbers against a company so e.g. company joe bloggs might
have project numbers 35 and 40 assigned against it.

I then have an activity form where users log information such as hours
worked with a company and they must also select a project number here - i
have no problem limiting the value in the project number field to the first
project field from the company form based on the company that the user
selects e.g. if company joe bloggs has project number 35 assigned to the
first project field and 40 assigned to the second proejct field then on the
activity form when selecting company joe bloggs the project field will only
allow you to select 35 - however i would like it to show BOTH 35 and 40 as
available for selection but am unsure of how to modify the rowsource query to
allow for this?


Having a table with a project1 field and a project2 field is
potentially a problem, especially if there can be fewer or
greater than two projects for a company. You should
seriously consider using a separate table for the project
numbers, in which case your combo box problem would
disappear.

In the meantime, you might be able to get by with using a
query along these lines:

SELECT project1 FROM companies
WHERE company = Forms!theform.txtcompany
UNION ALL
SELECT project2 FROM companies
WHERE company = Forms!theform.txtcompany
And project2 Is Not Null
 
Back
Top