Solved

Converting My filters into a text string

Posted on 2011-02-27
3
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Suggested Solutions

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

752 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