Solved

Converting My filters into a text string

Posted on 2011-02-27
3
201 Views
Last Modified: 2012-05-11
Hi,
A slightly different question.
I have a continuous form.
I will apply some standard Access filters to this form.
E.g. Show all records where Product = "Widget"

I want to write a log to a one field  audit table in the format ;

"28/02/2011 17:22:20    Filter Applied : Product = Widget"

How do I capture the "Product = Widget" as a piece of text.  It does not have to be exactly in this format - I merely want to record the details of the filter applied.

I am hoping that there is a simple solution for this.  If it is very complex than it might not be worth my while.


0
Comment
Question by:Patrick O'Dea
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
try
msgbox me.filter

see what comes out.

if that gives you what you need, you can do this

"28/02/2011 17:22:20    Filter Applied : " & me.Filter
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
Comment Utility
You might check to insure the Filter is on first, to avoid Null values:

If Me.FilterOn Then
  CurrentProject.Connection.Execute "INSERT INTO SomeTable(SomeField) VALUES '" & Now & " Filter Applied: " &  Me.Filter & "'"
End If
0
 

Author Closing Comment

by:Patrick O'Dea
Comment Utility
Thanks all,

Nice and easy
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now