>>> I have a complex query that takes about 7 to 10 minutes to run as a
>>> result of a "Like" expression over a network. I would like to run
[quoted text clipped - 90 lines]
>
> Dennis
Yes, that's right, Dennis. What I was suggesting was that you create a
table named "tblSettings", with a date/time field named
"MacroLastRunDate" (or whatever would make sense to you). There could
also be other fields to store other settings used by your application.
You'd put one record in this table when you create it, with the field
MacroLastRunDate initialized to some date arbitrarily long ago. Note
that the code I gave doesn't allow for the possibility that this table
might not exist -- That's why you're getting error 3078 -- nor that the
field might have a Null value. You could add code to cope with that
situation, but the simplest solution is just to create the table in
advance and put a record in it with MacroLastRunDate set to some "old"
date.
Incidentally, as a side issue, I'm a little concerned about the
implications of the capitalization of the word "DATE" in this line you
posted:
> If DLookup("MacroLastRunDate", "tblSettings") < DATE Then
Normally, the Date function will only have the "D" capitalized. Does
that mean you have some control, field, or variable that is named
"DATE"? If so, that could potentially interfere with the proper
interpretation of that keyword as a call to the function. Make sure
that the code is interpreting it properly.

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Don - 31 Mar 2005 04:07 GMT
> >>> I have a complex query that takes about 7 to 10 minutes to run as a
> >>> result of a "Like" expression over a network. I would like to run
[quoted text clipped - 115 lines]
> interpretation of that keyword as a call to the function. Make sure
> that the code is interpreting it properly.
Dirk, this database is on a network and I am trying to update this query on
the back end. This back end never is opened unless I am maintaining it or
upgrading the design. I realize that this form must be open for the update to
work (by the way, it works nicely thanks!!) and I was going to put it on one
of the front end remotes but there are problems with that senerio as well
(user does not show up to work and unit is turned off by accident or worse on
vacation). Unfortunatly this looks to be the best way so far. Is there
another way to run this macro or other means to run an update at the back
end without opening it?
Thanks,
Dennis
Dirk Goldgar - 31 Mar 2005 06:52 GMT
> Dirk, this database is on a network and I am trying to update this
> query on the back end. This back end never is opened unless I am
[quoted text clipped - 6 lines]
> way to run this macro or other means to run an update at the back
> end without opening it?
If the back-end is on a server that has a task scheduler service running
on it, you can use the task scheduler to start Access with command-line
arguments that tell it to open your back-end database and run a specific
macro. That macro can run your process, whatever it is, and then close
the database and quit Access.

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)