Filter Macro

DonkeyKong

Registered User.
Local time
Today, 07:22
Joined
Jan 24, 2013
Messages
61
Hey guys. I am new to this forum as of 5 min ago. I have recently begun taking some database classes and have become interested in Access. I have a little bit of programming experience in VBA using Excel. This is, obviously, not Excel!
What I need to know is how to use a button on a Form to filter data in a Table. Here's what I've got. I know it's not much, but I've been searching all over and cannot seem to find squat. Thanks!
I have the button setup and working, but it's the coding or linking of the table with the button or something? So far, I have not seen any effect from the clicking of the button.

Option Explicit
Private Sub cmdMacro_Click()

Me.Filter = "Account= 'CPTSUS'"
Me.FilterOn = True

End Sub

I have linked my table using the Data => Reference stuff in Form properties.
 
For that to work, the form would have to be displaying records from that table. That would mean it was the record source of the form (a property of the form).
 
errr.... can you tell me how to do that :) I have the table, but I don't know how to make them display on the form...
 
Set the form's record source property to the name of the table. The form wizard would do the basics for you.
 
No problem, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom