I was playing around with that because it does make sense to me. But I'm
stumped as to how to get the CutOffDate from my Form to the Queries??? Do
I have to create a temporary underlying, Table as Mark suggested, just to
hold that CutOffDate while I run my Queries? Or can I somehow Select the
CutOffDate right from the Form and pass it through to the Queries that I'm
using in my Macro?
Or can I just use the Conditions feature of Macros to get my Date? I've
been playing around with something like this, but Access complains that it
doesn't know what [Tables] is. I created my Phone Log Cutoff Date with only
a TextBox to hold a date then I put the following into the Condtion line of
my Macro:
[Tables]![Phone Log Minutes].[Date & Time]<[Forms]![Phone Log Cutoff
Date]![CutOffDate]
Even if it did work, I'm still puzzled as to how to pass the CutOffDate to
my Query.
Thanks
Robert
<pi********@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
One way is to point your query at a field on a form (no recordsource
behind it - it's just used to clllect query parameter values). So you
have a text field on your form that is formatted as a date, and then
pass that to the query.
SELECT ...
FROM MyTable
WHERE SomeDate = Forms![MyForm]![txtDate]
AND RecordStatus<>"Archive";
then if you turn that into an update query...
UPDATE MyTable
SET SomeDate = Forms![MyForm]![txtDate]
WHERE RecordStatus<>"Archive";
the filter stuff isn't quite right, I'm sure, but it should give you
some ideas.
if you point your queries at the form, then you can drop your macro
onto the form (in design view) and it'll add a button to execute it.
Once it's all working right, you' might want to shut off the warnings
and turn them back on when you're done.
DoCmd.SetWarnings False
DoCmd.OpenQuery "qappArchiveRecords"
DoCmd.OpenQuery "qupdMarkRecords"
DoCmd.SetWarnings True