Working with the querydef object issues...

B

Brad Pears

I am working in Access 2000.

I am creating a dynamic query on the fly and wonder if someone could post
code that allows me to do the following with the querydef object...

1) delete a column from the queries field list after the query has been
created
2) set a column to be NOT displayed (I want it left in the query but just
not selected for display depending on circumstances)
3) Set sort order on a particular field (I wanmt to change this at
anytime...)

I can not seem to find anything for any of this. I tried using the querydef
objects ".fields.delete("fieldname)" method but that did not work at all.
There does not appear to be much available as far as properties go on the
querydef object's field list...

Thanks, Brad
 
D

Douglas J. Steele

QueryDef objects don't have a Fields collection that you can work with.
You'll have to work with the query's SQL to do what you're trying to do.

I don't believe there's any way to achieve the subtlety you're seeking
between 1 and 2: the field's either in the query or isn't.
 
B

Brad Pears

Ok... thanks for that... That is pretty much what I was figuring on.

You are right on... by the way on your second point. :)
I was looking for two ways to achieve the same thing. I would just turn it
off if that was available - but if not - then deleting the field would have
been the other option...

Thanks, Brad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top