Changing column property through VB Code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ptmusthafa
    New Member
    • Jun 2007
    • 1

    Changing column property through VB Code

    Dear All,
    I have a request that I am working with vb. What all I need is, Using a vb form am trying to change a field property of Access table ie. i want to change the property "Allow Zero Length" in to "Yes" by default it is 'NO".
    when i am using like tb1.fields(1).A llow zero length = Yes , it shows error
    So, Any one can give me a solution.
    Thaks,
    Musthafa
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by ptmusthafa
    Dear All,
    I have a request that I am working with vb. What all I need is, Using a vb form am trying to change a field property of Access table ie. i want to change the property "Allow Zero Length" in to "Yes" by default it is 'NO".
    when i am using like tb1.fields(1).A llow zero length = Yes , it shows error
    So, Any one can give me a solution.
    Thaks,
    Musthafa
    If tb1 is a TableDef object?

    Assuming it is then

    tb1.Fields(1).A llowZeroLength = True

    should work.
    Last edited by MMcCarthy; Sep 5 '07, 04:02 PM. Reason: changing False to True

    Comment

    • Rinoa
      New Member
      • Sep 2007
      • 9

      #3
      If he wants to allow zero length then shouldn't the allow zero length property be set to true?
      In other words...

      tb1.Fields(1).A llowZeroLength = True

      Or am I misunderstandin g? ><

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by Rinoa
        If he wants to allow zero length then shouldn't the allow zero length property be set to true?
        In other words...

        tb1.Fields(1).A llowZeroLength = True

        Or am I misunderstandin g? ><
        My apologies, you are of course correct. I've edited my post accordingly

        Comment

        • Robbie
          New Member
          • Mar 2007
          • 180

          #5
          In other words, the values are True and False, rather than Yes and No.

          Comment

          • Rinoa
            New Member
            • Sep 2007
            • 9

            #6
            Exactly. Basically it's Boolean values. Boolean means that it can only be one thing or the other(kinda like on and off). From what you said Access seems to handle booleans with yes and no values, while VB, like most programming languages, handles it with true or false.

            on=yes=true
            off=no=false

            Mmccarthy- lol, thanks. That had me a bit confused.
            Last edited by Rinoa; Sep 6 '07, 05:05 PM. Reason: grammar

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Originally posted by Rinoa
              Exactly. Basically it's Boolean values. Boolean means that it can only be one thing or the other(kinda like on and off). From what you said Access seems to handle booleans with yes and no values, while VB, like most programming languages, handles it with true or false.

              on=yes=true
              off=no=false

              Mmccarthy- lol, thanks. That had me a bit confused.
              No problem. Glad you got it working.

              Comment

              Working...