Filtering an access database with buttons 
Author Message
 Filtering an access database with buttons

I would like to have a form header with buttons on it that I can press
to change the filter criteria for the form. It would contain peoples
names and update the filter when the button is pressed to show only
records with those poples names in a specific Name field.  I
understand how to read the Caption from the button, but how do I apply
that in a filter? I was panning on using at least half a dozen names
across teh top of teh header. Would it be better to use a list box?

How would I do this? Any help would be appreciated.



Fri, 27 Feb 2004 11:52:49 GMT  
 Filtering an access database with buttons
If there are not too many options, you can just use buttons. However, I
suggest it's better to use a combo box to save space on the dialog. Either
way, you can filter the recordset use the "Filter" property. The following
sample code assumes a combo box is used:

rs.Filter = "name = '" & DataCombo1.Text & "'"

Note: the apostrophe ' is necessary here.

I'm a Microsoft Employee, and I've been "encouraged" to include the
following information from our lawyers: this posting is provided "As Is"
with no warranties, and confers no rights. That means there is no warranty
of merchantability or fitness for a particular purpose, and no warranty of
non-infringement. See full details on terms of use.

Fri, 27 Feb 2004 14:12:55 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Filter by form - apply filter button required - Access 97

2. Filter a Combo Box filled from an Access database

3. error doing a FILTER on an Access database via Asp/VBScript and ADO

4. error doing a FILTER on an Access database via Asp/VBScript and ADO

5. Help filtering info from Access database.

6. Solution: Getting Filter Buttons/Any Buttons to work with a Form in Filter Mode.

7. Accessing a specific database file record using a command button

8. Accessing a database with command buttons

9. Link Option Buttons To Access Database

10. Hover Button style command buttons in Access 97?

11. Saving a filter as a query in back-end database

12. Drill Down Filter on textual databases


Powered by phpBB® Forum Software