Apr 29, 2014 #1 pbundrant Technical User Feb 24, 2002 51 US Hi, Can someone please tell me the code for a command button(on main form) to filter a subform(query based), Progress field for the number 100? Access 2010 TYIA, Patty
Hi, Can someone please tell me the code for a command button(on main form) to filter a subform(query based), Progress field for the number 100? Access 2010 TYIA, Patty
Apr 29, 2014 1 #2 MajP Technical User Aug 27, 2005 9,382 US Several ways to do it. You can set the sub filter property, change the source query, or use a master child link. Using the filter it would be something like dim subfrm as access.form dim strFilter as string set subFrm = me.nameofsubformcontrol.form subfrm.filter = "Progress = 100" subfrm.filteron = true Upvote 0 Downvote
Several ways to do it. You can set the sub filter property, change the source query, or use a master child link. Using the filter it would be something like dim subfrm as access.form dim strFilter as string set subFrm = me.nameofsubformcontrol.form subfrm.filter = "Progress = 100" subfrm.filteron = true
Apr 29, 2014 Thread starter #3 pbundrant Technical User Feb 24, 2002 51 US Thanks, I'll see if it works tomorrow. Have a good one! Patty Upvote 0 Downvote
May 1, 2014 Thread starter #4 pbundrant Technical User Feb 24, 2002 51 US MajP, Well I put the code in the on click event, it doesn't work. Private Sub cmdFilter100Percent_Click() Dim subfrm As Access.Form Dim strFilter As String Set subfrm = Me.cmdFilter100Percent.Form subfrm.Filter = "Progress = 100" subfrm.FilterOn = True End Sub Any other suggestions? Patty Upvote 0 Downvote
MajP, Well I put the code in the on click event, it doesn't work. Private Sub cmdFilter100Percent_Click() Dim subfrm As Access.Form Dim strFilter As String Set subfrm = Me.cmdFilter100Percent.Form subfrm.Filter = "Progress = 100" subfrm.FilterOn = True End Sub Any other suggestions? Patty
May 1, 2014 #5 PHV MIS Nov 8, 2002 53,708 FR What is the name of the subform's control ? Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
May 1, 2014 Thread starter #6 pbundrant Technical User Feb 24, 2002 51 US Not sure what you're referring to by subform's control? Main Form: frmDataEntryForm Main Form Command Button: cmdFilter100Percent Sub Form: frmLianzi_MDR_Form_Updates Sub Form Field to be filtered: Progress Upvote 0 Downvote
Not sure what you're referring to by subform's control? Main Form: frmDataEntryForm Main Form Command Button: cmdFilter100Percent Sub Form: frmLianzi_MDR_Form_Updates Sub Form Field to be filtered: Progress
May 1, 2014 1 #7 PHV MIS Nov 8, 2002 53,708 FR So, replace this: Set subfrm = Me.cmdFilter100Percent.Form with this: Set subfrm = Me.frmLianzi_MDR_Form_Updates.Form Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
So, replace this: Set subfrm = Me.cmdFilter100Percent.Form with this: Set subfrm = Me.frmLianzi_MDR_Form_Updates.Form Hope This Helps, PH. FAQ219-2884 FAQ181-2886
May 1, 2014 Thread starter #8 pbundrant Technical User Feb 24, 2002 51 US Thank you!!! You are so cool! Yes, I messed it up to begin with. Thanks so much y'all, Patty Upvote 0 Downvote
May 14, 2014 Thread starter #9 pbundrant Technical User Feb 24, 2002 51 US Hi, me again, How can I change this to exclude the 100 and include everything else under and the nulls? subfrm.Filter = "Progress = 100" something like "Progress < 100 or """ that doesn't work. TYIA, Patty Upvote 0 Downvote
Hi, me again, How can I change this to exclude the 100 and include everything else under and the nulls? subfrm.Filter = "Progress = 100" something like "Progress < 100 or """ that doesn't work. TYIA, Patty
May 14, 2014 1 #10 Andrzejek Programmer Jan 10, 2006 8,548 US Did you try: "Progress < 100 OR Progress IS NULL" Have fun. ---- Andy A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station. Upvote 0 Downvote
Did you try: "Progress < 100 OR Progress IS NULL" Have fun. ---- Andy A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
May 14, 2014 Thread starter #11 pbundrant Technical User Feb 24, 2002 51 US Just did!! Thanks, perfect Upvote 0 Downvote