Changing part of a Query depending on the macro I choose to run

J

John Ortt

I have a macro to run a monthly update which has the following criteria:
DateAdd("m",-24,Date())

When I am testing the database I would like to run the same query but only
for one month to save time.

Is the best way of doing this to use two separate queries and two separate
macros or can anybody think of an alternative.

Any help greatly appreciated.

Thanks,

John
 
J

Jackie L

If you are running your macro from a form, you can add two unbound fields for
the date range to the form then add those fields into the criteria of the
query. That way if you want to run for a month or whatever date range, you
can enter that at the time you run it. You would need to be cautious about
whether each record has a date in that field. Your query would eliminate the
records with no date unless you create a variable to accomodate null fields.

Please let me know if this is confusing. I would be happy to elaborate if
this is the direction you want to go.
 
Top