Solved Suform To Reproduce Emp List When Click Check Mark

Ashfaque

Search Beautiful Girls from your town for night
Local time
Today, 20:41
Joined
Sep 6, 2004
Messages
897
My subform name is SF_DeptwizeEmps which is based on a simple query with 2 fields namely CNo, CName, CDept.

I placed this subform on my main form named F_SaPercent. This forms have different lables placed on it that displays department name like:

HR
Admin
...
....

In front of each label, I have placed check mark (CheckHR). What I want now which ever check mark I clicks, the subform should produce list of those department employees only.

If Me.CheckHR.Value = 0 Then
Forms!F_Sapercent!Forms!SF_DeptwizeEmps.Rowsorce = Forms!F_Sapercent!CheckHR
SF_DeptwizeEmps.Requery
End If
End Sub

And when I checkmark for another example Admin lable, then the subform list should produce empls of Admin dept only. I tried But not success

Can someone help me?

Thanks,
 
Thanks June7,

Any other thought?
 
Do you want to allow selection of multiple departments or only one?

Have you looked at the tutorial? Tried anything?
 
Mulitple
I looked into but it is not for subform.
 
checkmark for another example Admin lable, then the subform list should produce empls of Admin dept only.
Be a lot easier if you used an unbound combo or listbox which listed the departments on the main form instead of check boxes.

Then in the subform properties put the name of the combo/listbox in the linkmaster property and the name of the field in the subform for the department in the linkchild property

then no code required
 
Be a lot easier if you used an unbound combo or listbox which listed the departments on the main form instead of check boxes.

Then in the subform properties put the name of the combo/listbox in the linkmaster property and the name of the field in the subform for the department in the linkchild property

then no code required
Thanks CJ_London,

It is a simple and easy method....It is working now..

Thanks to June7 as well for the support.
 
Referenced code could be adapted to apply filter to subform, especially if you want to allow multiple departments to be selected. Use a multi-select listbox. The referenced link has example of that.
 

Users who are viewing this thread

Back
Top Bottom