Trouble Filtering a Sub Form With Combo Box Options

  • Thread starter Thread starter pcm1977
  • Start date Start date
P

pcm1977

I have a subform (frmTask_sub) on my main for that has a default view
of datasheet. I would like to filter this form based on a combo box
(combo82) that is on my main form. The combo box has only two
columns, the first column is the table id field (not visible) and the
second column is "type". After browsing the group i have tried many
different methods suggested and none seem to work. Below is what i
have currently that gives me an error of "Compiler Error: Member or
data member not found" and then it highlights ".TypeofTask".

Private Sub Combo82_AfterUpdate()
DoCmd.ApplyFilter , Me.frmTask_sub,
Me.frmTask_sub.TypeofTask = Me.Combo82.Column(1)
Me.frmTask_sub.Form.FilterOn = True
End Sub

I have tried my different methods such as:

DoCmd.ApplyFilter , Me.frmTask_sub, Forms!frmTask_sub!TypeofTask =
Me.Combo82.Column(1)

and all i get is an error that states:

"...can't find the form 'frm_Task_sub' referred to..."

I have double checked and i am spelling the form name correctly. I am
out of ideas, is this possible?
 
:
I have a subform (frmTask_sub) on my main for that has a default
view of datasheet. I would like to filter this form based on a
combo box (combo82) that is on my main form. The combo box has
only two columns, the first column is the table id field (not
visible) and the second column is "type". After browsing the
group i have tried many different methods suggested and none seem
to work. Below is what i have currently that gives me an error of
"Compiler Error: Member or data member not found" and then it
highlights ".TypeofTask".

Private Sub Combo82_AfterUpdate()
DoCmd.ApplyFilter , Me.frmTask_sub,
Me.frmTask_sub.TypeofTask = Me.Combo82.Column(1)
Me.frmTask_sub.Form.FilterOn = True
End Sub

I have tried my different methods such as:

DoCmd.ApplyFilter , Me.frmTask_sub,
Forms!frmTask_sub!TypeofTask =
Me.Combo82.Column(1)

and all i get is an error that states:

"...can't find the form 'frm_Task_sub' referred to..."

I have double checked and i am spelling the form name correctly. I
am out of ideas, is this possible?
Your problem is that you have not opened form 'frm_Task_sub', you
have opened your main form which contains a copy of 'frm_Task_sub'

First you need to get the name of the subform control from the
properties, Be aware that it may not be the same as your source
object 'frm_Task_sub', It may be 'Child1' or similar.

To refer to that subform control you need to use a different syntax
as explained at http://access.mvps.org/access/forms/frm0031.htm
 
:
















Your problem is that you have not opened form 'frm_Task_sub', you
have opened your main form which contains a copy of 'frm_Task_sub'

First you need to get the name of the subform control from the
properties, Be aware that it may not be the same as your source
object 'frm_Task_sub', It may be 'Child1' or similar.

To refer to that subform control you need to use a different syntax
as explained  athttp://access.mvps.org/access/forms/frm0031.htm

Thank you, I will give it a try
 
Back
Top