Trouble Filtering a Sub Form With Combo Box Options

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?
 
B

Bob Quintal

:
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
 
P

pcm1977

:
















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
 

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

Top