A atrium Registered User. Local time Tomorrow, 02:49 Joined May 13, 2014 Messages 348 Nov 3, 2014 #1 Can I change the Records Source of a subform from within that subform and do a requery to have a different set of records displayed' I want to be able to refine the records displayed in the subform
Can I change the Records Source of a subform from within that subform and do a requery to have a different set of records displayed' I want to be able to refine the records displayed in the subform
bob fitz AWF VIP Local time Today, 15:49 Joined May 23, 2011 Messages 4,815 Nov 3, 2014 #2 atrium said: Can I change the Records Source of a subform from within that subform and do a requery to have a different set of records displayed' Click to expand... I think that should be possible. atrium said: I want to be able to refine the records displayed in the subform Click to expand... Why not just apply a filter.
atrium said: Can I change the Records Source of a subform from within that subform and do a requery to have a different set of records displayed' Click to expand... I think that should be possible. atrium said: I want to be able to refine the records displayed in the subform Click to expand... Why not just apply a filter.
A atrium Registered User. Local time Tomorrow, 02:49 Joined May 13, 2014 Messages 348 Nov 3, 2014 #3 How can I do that in VBA, as the event taken when a button is clicked on
bob fitz AWF VIP Local time Today, 15:49 Joined May 23, 2011 Messages 4,815 Nov 3, 2014 #4 atrium said: How can I do that in VBA, as the event taken when a button is clicked on Click to expand... Do what? Change the record source query or apply a filter
atrium said: How can I do that in VBA, as the event taken when a button is clicked on Click to expand... Do what? Change the record source query or apply a filter
A atrium Registered User. Local time Tomorrow, 02:49 Joined May 13, 2014 Messages 348 Nov 3, 2014 #5 Sorry for being a bit slow - it's been a long day I like to know how to do it both ways if I can Regards
Sorry for being a bit slow - it's been a long day I like to know how to do it both ways if I can Regards
bob fitz AWF VIP Local time Today, 15:49 Joined May 23, 2011 Messages 4,815 Nov 3, 2014 #6 To change the record source try: Me.RecordSource = "queryname" To apply a filter try something like: DoCmd.ApplyFilter , "NameOfFieldToBeFiltered= 'TextToBeFilteredBy'" You would NOT need the single quotes if the value is numeric.
To change the record source try: Me.RecordSource = "queryname" To apply a filter try something like: DoCmd.ApplyFilter , "NameOfFieldToBeFiltered= 'TextToBeFilteredBy'" You would NOT need the single quotes if the value is numeric.
A atrium Registered User. Local time Tomorrow, 02:49 Joined May 13, 2014 Messages 348 Nov 3, 2014 #7 Thanks Bob I'll get onto that today
A atrium Registered User. Local time Tomorrow, 02:49 Joined May 13, 2014 Messages 348 Nov 3, 2014 #8 I tried it in the subform but it applied it to the mainform. How do I get to just apply to the form This is the code I used Private Sub Command50_Click() DoCmd.ApplyFilter , "Operator = 11" Refresh End Sub
I tried it in the subform but it applied it to the mainform. How do I get to just apply to the form This is the code I used Private Sub Command50_Click() DoCmd.ApplyFilter , "Operator = 11" Refresh End Sub
A atrium Registered User. Local time Tomorrow, 02:49 Joined May 13, 2014 Messages 348 Nov 4, 2014 #9 I got around it Bob by using the Me.RecordSource = "queryname" and using a variable in the query for each operator selected from a drop down Thanks for all your help Regards
I got around it Bob by using the Me.RecordSource = "queryname" and using a variable in the query for each operator selected from a drop down Thanks for all your help Regards