Re: Resetting Filter (Combo Box) to All
- From: "Jeanette Cunningham" <nnn@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Jul 2009 20:16:55 +1000
I suggest that you have a look at a great search form sample on Allen
Browne's website.
If you follow his sample on how he builds the form filter and clears the
filter, I think it will make it easier for you.
http://allenbrowne.com/ser-62.html
I would also remove the default setting in the manufacturer filter - that
might be causing the need for clicking reset twice.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"KevinK" <KevinK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:681CB8DB-F267-4AAC-8CC4-4C494950F85E@xxxxxxxxxxxxxxxx
Hi Jeanette
Thank you for code. I have revised it to fit the program as such:
Private Sub cmdResetFilter_Click()
'Resets the Manufacturer Filter
gMfgID = Forms!PatternAddfrm!ManufacturerFilter.Column(0)
Me.ManufacturerFilter = Null
Me!PatternAddfsub.Requery
Repaint
End Sub
The only problem is I need to click the button twice to reset the
PatternAddfsub. I'm not sure why it doesn't with the first click.
Kevin
--
"Jeanette Cunningham" wrote:
Hi Kevin
an easy way is to have a reset button that will set the combo to null,
then
requery the subform.
The code below is untested air code that gives you the idea.
You may need to adjust it to suit your form.
Private Sub cmdReset_Click()
Me.NameOfCombo = Null
Me!PatternAddfsub.Requery
End Sub
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"KevinK" <KevinK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AC44999F-7BC8-401D-8F32-0BC6BBAF28C7@xxxxxxxxxxxxxxxx
What I have is a form in which I can assign a new pattern to a
particular
manufacturer. The form consists of a parent form with 2 filters at the
top.
Both of these filters are combo boxes. The first filters on category
and
the
second filters on manufacturer, based on which category is selected.
The
subform contains the pattern information. When a particular category
and
manufacturer are selected all the associated patterns will display.
The
problem I'm having is after I select a particular category and
manufacturer
and all the patterns are displayed. I placed a double-click event in
the
manufacturer filter to reset the manufacturer list to all within the
selected
category. the code I used is as follows:
Private Sub ManufacturerFilter_DblClick(Cancel As Integer)
'Double click action to filter on all manufacturer
gMfgID="*"
Me!ManufacturerFilter="*"
Me!PatternAddfsub.Requery
End Sub
The gMfgID is a global I created to help with searches and queries
throughout the program. The code for that is:
Function CurMfgID()
CurMfgID=gMfgID
End Function
I also set the default value in the ManufacturerFilter's properties to
"*".
When I double click in the ManufacturerFilter now the PatternAddfsub
fields
fill with #Name? or ####.
I have also set relationships between table with referential integrity.
Can
this be solved?
--
Kevin K
.
- References:
- Resetting Filter (Combo Box) to All
- From: KevinK
- Re: Resetting Filter (Combo Box) to All
- From: Jeanette Cunningham
- Re: Resetting Filter (Combo Box) to All
- From: KevinK
- Resetting Filter (Combo Box) to All
- Prev by Date: Re: Allow null value in a field
- Next by Date: Re: Printing a Form
- Previous by thread: Re: Resetting Filter (Combo Box) to All
- Next by thread: Custom Fields for End User?
- Index(es):
Relevant Pages
|