Field in current table check

J

Jim Stevens

I have a procedure which needs to be distributed to other project
analysts. When they run this procedure I would like to identify if
the current table has the Text6 field in it and if it is shown.
Something like the following is what I need but I am having trouble
figuring out the VBA logic. Thanks in advance to anyone that can
help... jim

For Each Field In ActiveProject.Tables.Fields
If Field Text6 Is Shown Then
MsgBox "Yes"
End If
Next Field
 
G

Gérard Ducouret

Hello Jim,
Look at the FieldConstantToFieldName method

Gérard Ducouret
See example below :

Sub FieldsInTable()
Dim champ As Object, i As Integer
With ThisProject.TaskTables("Entry")
For Each champ In .TableFields
i = i + 1
Debug.Print champ.Field, .TableFields(i).Width, .TableFields(i).Title,
FieldConstantToFieldName(champ.Field)
Next champ
End With
End Sub
 

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