MOPS2007: retrieve list of custom fields in a VBA macro

Q

Quized again

I have a macro that needs to allow the user to select which custom field to
use. I found references to pulling data from a custom field but nothing to
return the list of fields.
Is this hard to do?
 
R

Rod Gill

I think the simplest solution is to read the names of the columns at the end
of the Views ending with _userview from the Reporting database. All Custom
Fields are automatically added to them. For local fields, you just need to
manually add their names to your code.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
Q

Quized again

Thanks Rod! I found what you were saying in the RDB. Sorry to be a bother,
but how do I return the list of names from the column heading? I was thinking
that there was a table somewhere that would be easy to read but I can work
with the column headings with VBA code? I have your book, but I am not sure
it deals with this version of the SW.
Thanks again.
 
Q

Quized again

Ok, so I managed to come up with a SQL query that returns all the column
titles as a small victory. I also see that your book does cover 2007, but I
left it at home today.

Is it possible to populate a VBA drop-down selection box with the column
titles from the RDB?
 
R

Rod Gill

Hi,

I would create a recordset with all columns selected (*). Count the number
of fields in the View excluding the custom fields. now loop thru field ids
greater than this to get their names.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 

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