I have created mainform –caption “mainform†and in that Subform – caption
“subform1â€
In mainform I have created combo box –name “cmdException†for ExceptionType
and the record source is “Select ExceptionType from tblExceptionâ€
The tblException table is unique table for Exception Types. So it has ID
(PK) and Exception Type(Desc of Exception).
In subform Record source: “Select * from tblCustomerâ€
This table has ExceptionType field (FK of Unique tblException tbale)
So when I select value form dropdown combo box, it filters the match
exception type value in tblCustomer table and shows the matched rows.
So this is working fine - When I select another value form drop down combo
box , it filters accordingly.
But now I am working on How to come back to show all rows.
Should I created button on main form and write some code to show all value
in subform or ????.
I did put me.cmdException = Null after then tried even procedure on subform
me.filteron = false but as that was not working I have removed all even
procedures.
thanks for your quick replies.
Marshall Barton said:
I might be able to make another try if you provided enough
information about what you are doing. Putting the code I
suggested in the combo box's own AfterUpdate event is
certainly not going to work, so what do you expect users to
do to clear the filter?
I guessed that you were using the subform's Filter property
to filter the subform. If you are using a criteria in the
subform's record source query, what is the query's SQL?
Maybe there is some other code in the combo box's
AfterUpdate event that is getting in the way. If you would
post a Copy/Paste of the AfterUpdate event procedure, maybe
I will be able to spot a useful clue.
--
Marsh
MVP [MS Access]
No that's not working, when I set the code on combox after update, i can not
select the value from combox to filter the records but it does not unfilter
the data on subform.
keep trying, I tried .filteron = false but even thats not working.
:
kay wrote:
I have created combo box such that when you select the value from drop down
list, it filters the matched field value in sub form and display the related
rows.
How do I come back to view all data. I mean it should show all data on sub
form.
Try setting the combo box's value to Null and calling it
AfterUpdate event procedure:
Me.thecombobox = Null
thecombobox_AfterUpdate
.