473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Filter by Form... but only for Subform

Hi everyone! I was wondering if there is a away to use Access 97's
build in filter-by-form function but restrict its effect to just the
subform.

I have a parent form that shows the major divisions of the company,
and a subform that is linked so that it displays all the jobs within
the division in the parent form. I also want the ability to filter
the subform, so the users can pick out a bunch of common jobs easily.
I did this using a simple DoCmd.DoMenuItem command button to invoke
Access's filter-by-form.

Unfortunately, when this command button is hit (or even the
filter-by-form command invoked manually), the entire form, parent and
child, goes into filter mode; what's worse, if I enter a criteria
string into the subform, and leave the main form untouched, applying
the filter causes any filter criteria I had on the main form to be
lost. To top it all off, the main form is sent to the "first"
division record, so the user is now altering characteristics of an
entirely different division!

Is there a way to prevent the filter settings on the main form from
being altered while using the filter-by-form function on the subform?
Any suggestions would be greatly appreciated.

Alan
Nov 12 '05 #1
2 9756
No. You cannot use FilterByForm like that.

If you provide your own interface (e.g. text boxes in the Form Header
section, and a command buttton to apply a filter), you can set the Filter
property of the form in the subform control. It has to look like the WHERE
clause of a query. You can mock up a query and switch to SQL View (Viw menu
in query design) if you're not sure how to achieve that. And don't forget to
set FilterOn to True as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Andante.in.Blue" <05********@sneakemail.com> wrote in message
news:bc**************************@posting.google.c om...
Hi everyone! I was wondering if there is a away to use Access 97's
build in filter-by-form function but restrict its effect to just the
subform.

I have a parent form that shows the major divisions of the company,
and a subform that is linked so that it displays all the jobs within
the division in the parent form. I also want the ability to filter
the subform, so the users can pick out a bunch of common jobs easily.
I did this using a simple DoCmd.DoMenuItem command button to invoke
Access's filter-by-form.

Unfortunately, when this command button is hit (or even the
filter-by-form command invoked manually), the entire form, parent and
child, goes into filter mode; what's worse, if I enter a criteria
string into the subform, and leave the main form untouched, applying
the filter causes any filter criteria I had on the main form to be
lost. To top it all off, the main form is sent to the "first"
division record, so the user is now altering characteristics of an
entirely different division!

Is there a way to prevent the filter settings on the main form from
being altered while using the filter-by-form function on the subform?
Any suggestions would be greatly appreciated.

Alan

Nov 12 '05 #2
This is what I was afraid of. Will get started on an alternative
interface then. Thank you Allen!

Alan

"Allen Browne" <al*********@SeeSig.invalid> wrote in message news:<3f***********************@freenews.iinet.net .au>...
No. You cannot use FilterByForm like that.

If you provide your own interface (e.g. text boxes in the Form Header
section, and a command buttton to apply a filter), you can set the Filter
property of the form in the subform control. It has to look like the WHERE
clause of a query. You can mock up a query and switch to SQL View (Viw menu
in query design) if you're not sure how to achieve that. And don't forget to
set FilterOn to True as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
3
by: Tony Williams | last post by:
Sorry to repost but I cannot work this out. Can anyone come up with a suggestion? I have a main form based on Table1. The form has a tab control of three pages. Each page has a subform based on a...
2
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL...
2
by: Lenin Torres | last post by:
Hi everybody I have an Union Query that works fine. I used this query as the RecordSource for a Form. That Form is used as a subform in another form. Everything works fine, except for the "Filter...
3
by: dhowell | last post by:
In reading some of the posts on this group, it appears as though it is not strait forward at all to filter a form, which has subforms, by criteria which are either on subforms or span more than one...
0
by: diogenes | last post by:
"Rick Brandt" <rickbrandt2@hotmail.comwrote in news:bPnKj.456$%41.325 @nlpi064.nbdc.sbc.com: I used this approach, and it works a treat! ID In(SELECT Order_ID FROM orderitems WHERE NAME =...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
2
by: ccmanc68 | last post by:
I have on my main form two control text boxes: "ContractNo" and "Buyer", I also have a form control subform: "Contracts". Using the following code, If I enter "25" in the "Buyer" Control, this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.