3 Combobox controlling a Subform Datas

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

Guest

Hi..
a similary question was posted yerterday.

I have a form named:BonusForm
and I have a subform named:IDEmployeesubform

where it display all Employee in the company, then I have Three combobox
named:
First combobox is: Combo23 ( this combo has as source the Company Intern
Division)
Like Automotive, BodyArmor, DutyGear,
Second combobox is: Combo25 (This combo has as source the Areas of each
division)

third combobox is: LocationID (this combo has as source the Lines where each
employee is working)


what I want is: if I select a company Division all employees that work on
this division are displayed in the Subform, then if I select an AREA , the
subform only must display employees of that Area, then if I select LocationID
just must appear Employees that work in that specific Line or Location.

Note: The relationship is already done
from LocationID to AreaID to DivisionID

can you help me with this,
Thanks.
 
Hi Ofer. I put this code but it does not work I don't know why? could you
take a look at it please.


SELECT * FROM IDEmployeeQuery WHERE ([IDDepartment.Name] =
Forms![BonusForm]![Combo23] Or Forms![BonusForm]![Combo23] Is Null) And
([Area] = Forms![BonusForm]![Combo25] Or Forms![BonusForm]![Combo25] Is
Null) And ([LocationID] = Forms![BonusForm]![LocationID] Or
Forms![BonusForm]![LocationID] Is Null)


Thanks

--
Lorenzo Díaz
Cad Technician


Ofer said:
To continue the post from yesterday, you can change the record source of the
sub form to link to all combo's

Select * From TableName Where ([Company field name] =
Forms![BonusForm]![Combo23] Or Forms![BonusForm]![Combo23] Is Null) And
([Areas field name] = Forms![BonusForm]![Combo25] Or
Forms![BonusForm]![Combo25] Is Null) And ([LocationID field name] =
Forms![BonusForm]![LocationID] Or Forms![BonusForm]![LocationID] Is Null)

On the after update event of the each combo run
Me.[SubFormName].Requery

--
\\// Live Long and Prosper \\//
BS"D


ldiaz said:
Hi..
a similary question was posted yerterday.

I have a form named:BonusForm
and I have a subform named:IDEmployeesubform

where it display all Employee in the company, then I have Three combobox
named:
First combobox is: Combo23 ( this combo has as source the Company Intern
Division)
Like Automotive, BodyArmor, DutyGear,
Second combobox is: Combo25 (This combo has as source the Areas of each
division)

third combobox is: LocationID (this combo has as source the Lines where each
employee is working)


what I want is: if I select a company Division all employees that work on
this division are displayed in the Subform, then if I select an AREA , the
subform only must display employees of that Area, then if I select LocationID
just must appear Employees that work in that specific Line or Location.

Note: The relationship is already done
from LocationID to AreaID to DivisionID

can you help me with this,
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top