By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,364 Members | 1,671 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,364 IT Pros & Developers. It's quick & easy.

Get list of custom properties

P: n/a
Hi folks,
Just wondering if there is a way to retrieve a list of the names of
custom properties (not inbuilt) after they have been saved to a db in
order to populate a listbox? I have around 5 custom properties but
possibly more in the future and rather than hard-coding the names of
the properties would much prefer them to be gathered automatically. If
you have any ideas it would be greatly appreciated. I can retrieve the
values of the properties without any problem, I just can't work out how
to reference the Name. Thanks, Anton

Dec 7 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hello Anton,

The only thing I have been able to come up with is this:

Dim DB As DAO.Database, prp As DAO.Property
Set DB = CurrentDB
For Each prp In DB.Properties
Debug.Print prp.Name
Next
What I would do is to get a list of all the built-in/non-custom
properties and store that list in a table - say tblProperties. Then
when you loop through the properties colletion -- you compare prp.Name
with the list of built-in properties you stored in tblProperties. If
prp.Name is not in tblProperties, then it is a custom property and you
can list it in your listbox.
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Dec 7 '05 #2

P: n/a
Thanks Rich I will give that a go :)

Dec 8 '05 #3

P: n/a
Erm, maybe I'm being dim here but if you are going to maintain a list of the
custom properties that you are going to add to the database so you can check
which properties are custom; then why don't you just store the values you
are now storing in your custom properties in the table and get rid of the
custom properties as they become redundant?

--
Terry Kreft

"Anton" <an******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Thanks Rich I will give that a go :)

Dec 8 '05 #4

P: n/a
Hi Terry, I am trying this method for two reasons. The first is as an
automatic update process as the db I am developing is constantly being
revised, however because of how it is delivered I can not use a FE/BE
config, nor can I save to the registry as the users carry the db from
machine to machine, I had also used a dat file to save the version
data, but because of the administration system that this db serves is a
stuborn SOB I had to revise. I then started by declaring a global
constant and using it to identify the version date and had it so that
the constant could be changed via a procedure/form. Hence this post. I
did then turn to the idea of throwing the data in a table (which of
course does sound like the most logical method), but alas, am trying
this alternative; which brings me to my second reason. Learning
alternative ways of performing a task is in itself (to me anyway)
really quite rewarding and I thank both yourself and the members of
this group for their knowledge, time and views. Thanks mate.

Anton

Dec 8 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.