The solution to the problem of this original post is very simple. (Reread the original problem at the top of this thread)
The filter string in the line
Code: Select all
strFilter="'Date Acquired' > {D '" & oFilter.Text & "'}"
is incorrect.
You need to use double quotes around the field name, not single quotes. I haven't researched how to do this in Basic within the construct of double quotes but no doubt this is a straight forward language construct. The filter string itself that is being set should look something like this:
Code: Select all
( "Date Acquired" > {D '2010-04-01' } )
It is worth noting how I got to this solution. Villeroy pointed me to the tools that provided a beeline to the answer. I used the MRI tool. This tool is
really powerful. It provides point-and-click access to the methods and properties of the objects of your runtime system. It allows for navigating these objects with double clicks. It allows you not only to explore the structures of a running system, but also to change them on the fly as you would in code, but without writing code. When you do so it writes and records the code for you so that you can cut-and-paste it when you work out your solution. It allows you to call simple methods, even some methods that require simple parameters. It provides popup windows with selection lists of indexes or names for collections indexed as such.
I used the MRI tool to get a hold of the Form and then used the MRI interface to experiment with various filter strings. Here is explicitly what I did:
1) Through any event call from the form (I put down a button and used its execute event) I put the following MRI debug line in:
2) This brought up the an MRI inspector window on the ThisComponent object. From here I double clicked the getDrawPage() method (or the equivalent property DrawPage, either works).
3) From the resulting MRI inspector window which now is inspecting the drawpage, I double clicked the getForms() method.
4) From the resulting MRI inspector window which now is inspecting a Forms collection, I double clicked the getByName() method. This presents a selection list of the Forms in this collection. I double clicked the desired form name.
5) The MRI inspector is now inspecting the form, which is the target that holds the filter string of this original post.
6) I now selected the properties and using the Get and Set modes from the Mode dropdown menu on the menubar of the inspector window, I examined and set the Filter property.
7) When changing the Filter property, I went to the methods listing of the inspector and double clicked the reload() method to see the effect of the filter change.
Using this tool, I was able to reproduce the original problem and find the solution. All of this was done with
one line of code. Again, here is the line:
The rest was point and click.
See above posts and replies to point you to getting MRI running. Explore all its features. It is really worth it!