Adding a property to a query object

S

SuperScooper

I'm setting up a form that will allow me to quickly apply/update
properties to forms, queries, reports, etc in an access 2000 database.

Using the following, I can quickly add and update a user defined
property on my forms:

Dim obj As AccessObject

For Each obj In CurrentProject.AllForms

obj.Properties.Add ("RevDate"), Date$
obj.Properties.Add ("RevTime"), Time$
obj.Properties.Add ("Version"), "v1.0"

Next obj

The problem I'm having though involves attempting similar code with
queries. ie, the following code generates a 2467 error "The
expression you entered refers to an object that is closed or doesn't
exist"

Dim obj As AccessObject
Dim dbs As Object
Set dbs = Application.CurrentData

For Each obj In dbs.AllQueries

obj.Properties.Add ("RevDate"), Date$
obj.Properties.Add ("RevTime"), Time$
obj.Properties.Add ("Version"), "v1.0"

Next obj

Anyone know if it is possible to append a user defined property to the
query object?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top