Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

How read or write the Caption of table fields?

Discussion in 'Information Technology' started by Fjordur, Jul 28, 2006.

  1. Fjordur

    Fjordur
    Expand Collapse
    Guest

    Hi,
    I can't seem to find how to read / modify the Caption property of table
    fields from VB. Can it be done? How?
    For Each Fld In Tble.Fields
    Debug.Print Fld.Caption
    Next Fld
    gives me "Method or data member not found"...
    --
    Fjordur
     
  2. Loading...

    Similar Threads Forum Date
    Can This Thread Be Deleted Questions and Answers Jan 3, 2017
    Literature Has Anyone Read: "The Sikh Religion: Its Gurus, Sacred Writings And Authors" Language, Arts & Culture Oct 22, 2016
    Does Reading Baani Magically Affect Our Body And Psyche? And Does The Effect Depend On The Bani Read Intellectual Translations by SPNers Apr 30, 2016
    Sikhi Am I Ready To Take Amrit? Sikh Sikhi Sikhism Mar 10, 2016
    Emphasis When Reading Gurbani Intellectual Translations by SPNers Feb 14, 2016

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Several of these properties do not exist if you have nothing in the
    property. That's true for the Description of the field, and other properties
    too.

    You can use a function with error handler to see if the property exists:

    Public Function HasProperty(obj As Object, strPropName As String) As Boolean
    'Purpose: Return true if the object has the property.
    Dim varDummy As Variant

    On Error Resume Next
    varDummy = obj.Properties(strPropName)
    HasProperty = (Err.Number = 0)
    End Function

    Or you can just use error handling in your code to recover from the error.
    This example illustrates how to do that with the field Descriptions:
    http://allenbrowne.com/func-06.html

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Fjordur" <someone@microsoft.com> wrote in message
    news:446d9488$0$7997$626a54ce@news.free.fr...
    > Hi,
    > I can't seem to find how to read / modify the Caption property of table
    > fields from VB. Can it be done? How?
    > For Each Fld In Tble.Fields
    > Debug.Print Fld.Caption
    > Next Fld
    > gives me "Method or data member not found"...
    > --
    > Fjordur
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page