> I am having a problem coding a field in access2000. I am applying a
> Filter by Selection using VBA within access that goes as follows:
> Private Sub Category_Change()
> Select Case Category.Text
> Case "First Nations"
> DoCmd.ApplyFilter , "Category = 'First Nations'"
> Case "Independent"
> DoCmd.ApplyFilter , "Category = 'Independent'"
> Case "Company"
> DoCmd.ApplyFilter , "Category = 'Company'"
> Case "College/University"
> DoCmd.ApplyFilter , "Category = 'College/University'"
> Case "Correspondence"
> DoCmd.ApplyFilter , "Category = 'Correspondence'"
> Case "Junior High School"
> DoCmd.ApplyFilter , "Category = 'Junior High School'"
> Case "Senior High School"
> DoCmd.ApplyFilter , "Category = 'Senior High School'"
> Case "Special Needs"
> DoCmd.ApplyFilter , "Category = 'Special Needs'"
> Case "Other"
> DoCmd.ApplyFilter , "Category = 'Other'"
> End Select
> End Sub
> What is happening is that the filter is working properly, although,
the
> record that is displayed when the "category" is changed is then
changed
> into the "category" that the filter is applied to.
> example:
> Category: First Nations <--Category Record is currently in
> SchoolName: School1
> Street: 1234 Main st
> When you select another entry in the "Category" drop down list then
the
> filter is applied, although it also changes the current record (above)
> to the field selected to filter by(eg: Independent) and lists all the
> other files matching the "category" filter as well
> Category: Independent <-- When putting on filter to view all
> SchoolName: School1 independent schools the current record then
> Street: 1234 Main st changes to Independent
> To summerize, the filter is working properly. I just need some way so
> that the current record isnt changed(updated) when it is applied
> I have tried "form_main.Refresh" at the end of the code but it doesnt
> seem to do anything
> if you need to see what the form looks like, you can view it at
> http://www3.telus.net/intrigue/Jarrett
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Sent via Deja.com http://www.deja.com/