Very strange. On my system, using a copy of Northwind that serves as a scratchpad of sorts, I
get the following results in the immediate window:
querieswithdol
Number of queries: 126
Number of queries with DOL property: 61
There are only 65 queries visible in the database window with show hidden objects option checked.
Also, Total Access Analyzer lists 65 queries. It appears as if several of the queries are
temporary queries (present even after doing a compact and repair). I added three debug.print
statements to Brendan's procedure:
If prp.Name = "DOL" Then
lngCount = lngCount + 1
Debug.Print qdf.Name
Debug.Print prp.Value
Debug.print
Else
When I rerun the procedure, I get results that look like this (Note: prp.value includes several
square boxes for some of the queries, which represent unprintable characters. I'm not sure how
these will appear after I post this message):
~sq_cCustomer Orders~sq_cCustomer Orders Subform2
?? ???????? ???????Products ???????? ???????Order Details ???????? ????????OrderID
???????? ????????ProductID ???????? ????????ProductName ???????? ????????UnitPrice
???????? ????????Quantity ???????? ????????Discount ???????? ????????ProductID
~sq_cfrmCustomerOrders~sq_cCustomer Orders Subform2
?? ???????? ???????Products ???????? ???????Order Details ???????? ????????OrderID
???????? ????????ProductID ???????? ????????ProductName ???????? ????????UnitPrice
???????? ????????Quantity ???????? ????????Discount ???????? ????????ProductID
Category Sales for 1997
??
Current Product List
?? ???????? ?????H?bProducts
Customers and Suppliers by City
??
Tom
____________________________________
"Brendan Reynolds" <brenreyn at indigo dot ie> wrote in message
Not on my system, Sergey ...
Public Sub QueriesWithDOL()
Dim qdf As DAO.QueryDef
Dim prp As DAO.Property
Dim lngCount As Long
Debug.Print "Number of queries: " & CurrentDb.QueryDefs.Count
For Each qdf In CurrentDb.QueryDefs
For Each prp In qdf.Properties
If prp.Name = "DOL" Then
lngCount = lngCount + 1
End If
Next prp
Next qdf
Debug.Print "Number of queries with DOL property: " & lngCount
End Sub
In the Immediate window ...
querieswithdol
Number of queries: 436
Number of queries with DOL property: 0
--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com
The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.