Graph With Filtered Table (1 Viewer)

robertbwainwright

Registered User.
Local time
Today, 15:52
Joined
May 2, 2012
Messages
62
Hi all,

I have a split form with graphs in the upper design section and the table of the data that the graphs represent in the data view underneath. I would like to make the graphs dynamic with the data from the forms if the data is filtered in design view.

I know how to get the filter from the data view by using the .filter and I would like to use that as part of an SQL statement in my Rowsource for the graphs to dynamically change the graphs when a filter is used. My problem is the data is returned with .filter function returns with quotation marks (example below), and because I'm wanting to use that data in a string to change my rowsource the quotes need to be replaced with an apostrophe. How can I change the quotes to an apostrophe, or is there a better way to "filter" a graph?

Example:

Returned from .filter
([FrmTable].[CurrentABCS]="A")


What I need:

([FrmTable].[CurrentABCS]='A')



Thanks!
Robert
 

TJPoorman

Registered User.
Local time
Today, 14:52
Joined
Jul 23, 2013
Messages
402
You should be able to do this with the replace function:

Replace(.filter,""","'")
 

robertbwainwright

Registered User.
Local time
Today, 15:52
Joined
May 2, 2012
Messages
62
You should be able to do this with the replace function:

Replace(.filter,""","'")

Actually tried that earlier. I ended up solving this myself by using:

Replace(Me.Filter, Chr(34), Chr(39))
 

Users who are viewing this thread

Top Bottom