Link to home
Start Free TrialLog in
Avatar of Bevos
Bevos

asked on

Access 2007: Add Filter to VBA Script controlling export of data to MS Word?

Hi everyone, I have a VBA script that experts here have crafted over time which exports selected fields (as captions) to a Microsoft Word document.  I know how to create a 'filter' in a SQL query with where clauses, but I would like to implement a method to do this on the form.  I wanted something similar to: http://allenbrowne.com/AppSearchHighlight.html (the highlighting is optional but I liked the search box with combo box populated by relevant fields).  I've tried to modify this code with my form 'MakeWordTable' but it doesn't seem to be working.  I've attached the database here if anyone can take a look at what I'm doing and try to help I'd very much appreciate it.  As of now I keep getting errors saying that it can't find the field I've inputted into the combo box.   If users think I am barking up the wrong tree with this approach let me know that as well and please offer another suggestion.  Even a simple solution would be excellent.  My ultimate goal is to perhaps have two or three methods for the user to filter the data on the MakeWordTable form.  

I'm attaching the file here if anyone is interested in looking.

Thank you so much,
Bevo
EE-AbsRev.mdb
ASKER CERTIFIED SOLUTION
Avatar of Nico Bontenbal
Nico Bontenbal
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bevos
Bevos

ASKER

This works, jawesome nicobo.

So you are saying i should remove all code ascribed to items and it will still work?

Yes, delete the
Private Sub cboField_AfterUpdate()
and
Private Sub txtSearchText_AfterUpdate()
procedures, and it will still work.
Avatar of Bevos

ASKER

Thanks so much Nicobo!