Option Group Filter

Neo90815

Registered User.
Local time
Today, 22:09
Joined
Jul 26, 2000
Messages
64
Thanks for ready this, any help is greatly appreciated.

Filters already been saved as a Query for each users; Currently users can filter this way:
1) Click on "Filter by Form" command button on Tool Bar
2) Click on "Load Form Query" command button on Tool Bar
3) Select desire Filter (QueriesName) from "Applicable Filter" dialog Box (This filter is base on queries) & click okay
4) Click on "Apply Filter" command button on Tool Bar, Click again to Remove Filter.

.. The above steps work perfectly if users use want to see their items; ie Open items for Joe Smith.. or John Dow.

To make this more user friendly, we would like to add Option Group Filter; when user click on their names only the filter items associated with their name would display on the form.

Option Group has been created;
Option One Value 1 , Joe Smith
Option Two Value 2, John Dow, etc...

Any suggestios on codes? Thanks a million in advance. Neo
smile.gif
 
Hey there,

I'm trying to do something similar. I've been tinkering with some code which works in one program but not the one im working on. It loads the data associated with what item a user selects from a ListBox

It is as follows:

Dim varSelectedItem As Variant
Dim frmItem As Form
Dim frmVendor As Form
Dim frmInternal As Form
Dim strFilter As String

'get the item that the user selected
varSelectedItem = lstItems.Column(0)
'Make a filter
strFilter = "[QuoteItem]= """ + lstItems.Column(0) + """"

'Get a reference to the form on the first tab
Set frmItem = Me![FormName].Form

frmItem.filter = strFilter
frmItem.FilterOn = True

- like i said it works in one program but not in another and im doing the exact same thing so i dont know what wrong with it.

but hope this helps and/or gives u some ideas.

do u know anything that would help me out??

- Topher
 
Hi Topher,

I'll try you code. Actually I found the code doing what I want to do BUT..it's not working for me. Pretty simple, and understanding but.. does not work for me. (Found it my text book).

Group Option
..All Contacts (Option 1)
..New York Contact (Option 2)
*************************************
'This suppose to filter base on selection
Private Sub FilterOptions_AfterUpdate()
'Apply or remove the filter for
'option the user chose.

If FilterOptions = 2 Then
Me.Filter = "[FieldName] = [Value]'"
Me.FilterOn = True 'Apply Filter
Else
Me.FilterOn = False 'Remove Filter
End If

End Sub
*******************************************

Sorry, I don't know the answer to your
question.
frown.gif


Neo
 
I was working on a similar project for a dog warden service and wanted to limit the display of records to "stray","lost" and "fouling".

I added an option group to the form, and then built a query based on the results with a corresponding iif() statement to return the correct string(e.g.iif OptionGroup =1, "Stray",nested iif() statements)

I then added an on click procedure to each option button that re-ran the query and refreshed the form.
Note: My form refreshed a list box, if you want the options on the same form you might be better considering a combo box filled the names of the employees and use that as your filter criteria.

Just a few thoughts

formatian


This worked for me
 

Users who are viewing this thread

Back
Top Bottom