Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

Filtering a subform from a Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gman063 - 18 Oct 2005 20:11 GMT
I know this subject has been covered allot, but I don't think I am getting it.
What I am trying to do is basically actively filter a sub form based on what
the user puts in a textbox on the main form. Additionally, I am trying to
have the filter return records that contain the character that the user has
entered. (I.E. if they enter "eg" it will return all records with it in the
string)

Table contains numerous fields but only using three field in the sub form. My
parent form has no control source, just the text boxes I am using to filter
the sub form. The sub form is continuous form based on a query with a command
button that will open a form with all the details. I have been working on
this for quite some time and have run into a brick wall. I am pretty sure I
am over thinking this. Any help will be much appreciated.
Mike - 19 Oct 2005 06:03 GMT
I have the same thing, which works OK.
I have done as follows:

Suppose:
1) the name of the unbound main form is "MyMainForm"
2) the name of the subform control on the "MyMainForm" is "MySubForm"
3) you want to filter records according to the value of the unbound control
"SearchText" on the main form

Set the DefaultValue property of "searchText" control ="*"
Put the following code for the AfterUpdate property of the "SearchText"
control:

  Me.MySubForm.Requery

The record source of the subform should be a query.
Open this query and select the neccesary column and type the following into
the Criteria cell:

  Like [Forms]![MyMainForm]![SearchText]

Save the query.

Now type "*eg*" in the "SearchText" control of the main form and press
Enter...

> I know this subject has been covered allot, but I don't think I am getting it.
> What I am trying to do is basically actively filter a sub form based on what
[quoted text clipped - 9 lines]
> this for quite some time and have run into a brick wall. I am pretty sure I
> am over thinking this. Any help will be much appreciated.
Gman063 - 19 Oct 2005 16:01 GMT
Mike thanks for the reply. I had actually set my form up that way but left
out the Defualt value property and the use of wild cards. Thanks....works
great now.

Glenn

>I have the same thing, which works OK.
>I have done as follows:
[quoted text clipped - 27 lines]
>> this for quite some time and have run into a brick wall. I am pretty sure I
>> am over thinking this. Any help will be much appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.