Filtering via vba

Grunners

Registered User.
Local time
Today, 12:26
Joined
Jun 25, 2002
Messages
59
All,

I promise I have searched before posting (I've even been to utteraccess). It all looks so easy but isn't quite doing what it should...

I've got a form with quite a few fields on - it's bound to a table.

One of the form controls is AccountNo - this is probably the most frequently used control on the form and a number of records might have the same AccountNo. So instead of users having to use the built in toolbars to manually search and then filter for all equal records I've got a textbox for them to fill in.

They'll type in the Account number they're looking for - hit a command button and the form 'should' only show the records with that particular account number.

I've tried the DoCmd.ApplyFilter and Me.Filter methods and the filter icon in the toolbar does indeed look as though it's been pressed. I've just still got my entire recordset to scroll through instead of a handful of records.

The only things I can come up with now are using a combo box instead of a text box as all the examples use this (not that I think it would make a difference!) or could it be because i'm bound to a table and not a query?

If anyone's got a snippet of code they know to work I'd love to see it!

Many thanks in advance...
 
Hello:
'
Please my enclosed example: That does what you ask and should give you some ideas.
Regards and good luck
Mark
 

Attachments

That did it!

Many thanks and please accept my apologies for such a late reply.
 

Users who are viewing this thread

Back
Top Bottom