Full Version: Filter subform by textbox entry
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
MAbdul
Hi all,

I have a textbox on my form called: EnterPostcode, where the user enters a postcode and i have a subform on my form which i want to be able to filter with the entry in the textbox. The field in the subform that i wish to filter by is called: A4. I want the input of EnterPostcode to filter A4 on my subform, how can i achieve this?. Any help appreciated, thanks in advance,

MA.
MAbdul
Hi all,

I still have not been able to resolve problem. I have tried to place code in the after update of my textbox like so but does not seem to effect subform but effeect record no on main form:

CODE

Private Sub EnterPostcode_AfterUpdate()
   Me.RecordSource = "SELECT SEARCH.* FROM SEARCH WHERE A4 LIKE '" & Me.EnterPostcode.Value & "'"
End Sub


Where EnterPostcode is textbox name, search is table i am trying to filter and A4 is field which has the criteria by which i am trying to filter. The Search table is in datasheet view on subform Sub_Search. The textbox EnterPostcode is on my main form called ma_search2.

Any ideas on how i may be able to filter a table on my subform by a textbox on my main form, thanks in advance for any help,

MA.
LittleViews
You might find this helpful: Syntax
MAbdul
Thanks Karen,

That was very useful have now managed to get it to work,

MA. yayhandclap.gif thumbup.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.