Change a Query fields criteria in VBA

Smee

Registered User.
Local time
Today, 01:59
Joined
Dec 16, 2003
Messages
69
Hey All,

I've had a search for the last hour, but I haven't found anything for this topic. :confused:

I have a query def (qdf) setup for query1

I want to change the criteria part of qdf.fields(0) from:

=date() -1
to
=date() - x : x will change in the code.

I was hoping for something like qdf.fields(0).criteria but that doesn't exist (unless I have a missing reference).

Any ideas?

Thanks
 
Little Help here

Hey Smee--could you post an example of the code you're using? I'm pretty new to VBA in Access (I'm familiar with using it in Excel), and could use some pointers. It sounds like what you're doing is very similar to what I'd like to do (use a userform to alter Report queries). Do you mind sharing the wealth?

Thanks!

-NFJ
 

Users who are viewing this thread

Back
Top Bottom