# Getting query criterion



## Melody Thaw

Hello everyone,

I would like to ask about Query Criteria in Access VBA. I am new to VBA.
Now I am trying to create customize query design view form with VBA. I want to show fields name and criteria of saved query. 
But I am not sure how to get query criteria expression. I don't know whether there is a way to get criteria expression from a query with VBA.

So could someone help me for it?

Thanks in advance. 

Melody


----------



## welshgasman

Do not believe in starting off easy, do you? 
I believe you would need to parse the sql string, looking for Where or Having until the next keyword like Order.


----------



## Micron

You want only the criteria or you want the whole sql statement? For the latter, not so hard (stored query is a QueryDef object and has a sql property that is the full sql of the query). Getting only the criteria is another story as welshgasman says.


----------



## jackd

melody,
I suggest you show us a mockup of what you expect.


----------

