Solved

Converting My filters into a text string

Posted on 2011-02-27
3
202 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 34992445
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
ID: 34992544
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
ID: 34992848
Thanks all,

Nice and easy
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

770 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