+ Reply to Thread
Results 1 to 2 of 2

.Value necesary?

  1. #1
    Registered User
    Join Date
    07-01-2009
    Location
    Maryland
    MS-Off Ver
    Excel 2003
    Posts
    35

    .Value necesary?

    I have found that in some situations I can leave off the .value part of a form object and the statement will still refer to the value of the object.

    For instance Option Buttons can be tested with just their name, and no .value.

    Are there only certain objects that this works for, or is .value superfluous?
    Last edited by Pherion; 07-27-2009 at 05:48 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: .Value necesary?

    most objects have a default property.

    for option buttons, checkboxes textboxes it's .Value
    for labels it's .Caption

    If you use the object browser the default properties have a green tick/blob on the icon.

    Although it is possible to code using the default property, that is not specifying it, it is better practice to use it.
    It will make your codes intent much clearer when revisting your code.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1