form filtering

dillon

New member
Local time
Today, 08:46
Joined
Apr 8, 2012
Messages
4
Hi,
How do you create an on click event that will filter form records to show a hard coded set of records.

For Example: I have a Table tblA and a column colA. If you press a command button it only shows results where colA = 5.

Note: I have Access 2003 and it is just a regular Access Database NOT SQL.
 
something like:

private sub Yourbutton_Click()
me.filter = "colA = 5"
me.filteron = true
end sub
 
Hey, Thanks for the reply! Although I had already tried that method and it did not work So I thought it must be for another version or something. I have already figured out that the problem was there was another filter on so I had to clear that before it worked. Do you know a way to filter so the table it is relating to is not opened while it filters?
 
you can create 2 queries and change between them by setting the recordsource..
 

Users who are viewing this thread

Back
Top Bottom