T
Tim
I want to activate a filter on my data from a form command button.
The filter will search date fields in several separate tables where
the primary key matches to that in my current data (that the form is
based on). These many separate date fields are compared to yet
another date field that is in yet another table. If any one of them
is greater than the one being compared to, then this is type data I
want to see, the rest filtered out.
I put together a query with many DLookup's, and then launch the query
using DoCmd.ApplyFilter on my forms command button. It is working,
but takes about 8 minutes to run against 6000 records (to come up with
about 6 when the filter is done). This is with everything on my local
machine. When in place, it will be pulling the data over T1's.
Here's my Query that is working: (queQuotations is the Query that my
main form is based on):
((((DLookUp("[NCCommentsUpdate]","tblNewConstruction","[Quote #] = '"
& [queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[NCStrengthUpdate]","tblNewConstruction","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[ESCommentsUpdate]","tblEngineering","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[ESStrengthUpdate]","tblEngineering","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[EUCommentsUpdate]","tblEndUser","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[EUStrengthUpdate]","tblEndUser","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))))
Thanks for any help!!
The filter will search date fields in several separate tables where
the primary key matches to that in my current data (that the form is
based on). These many separate date fields are compared to yet
another date field that is in yet another table. If any one of them
is greater than the one being compared to, then this is type data I
want to see, the rest filtered out.
I put together a query with many DLookup's, and then launch the query
using DoCmd.ApplyFilter on my forms command button. It is working,
but takes about 8 minutes to run against 6000 records (to come up with
about 6 when the filter is done). This is with everything on my local
machine. When in place, it will be pulling the data over T1's.
Here's my Query that is working: (queQuotations is the Query that my
main form is based on):
((((DLookUp("[NCCommentsUpdate]","tblNewConstruction","[Quote #] = '"
& [queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[NCStrengthUpdate]","tblNewConstruction","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[ESCommentsUpdate]","tblEngineering","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[ESStrengthUpdate]","tblEngineering","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[EUCommentsUpdate]","tblEndUser","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))) OR
(((DLookUp("[EUStrengthUpdate]","tblEndUser","[Quote #] = '" &
[queQuotations].[Quote #] &
"'"))>DLookUp("[UserDate]","tblUserViewed","[Quote #] = '" &
[queQuotations].[Quote #] & "'"))))
Thanks for any help!!