Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    Washington D.C.
    Posts
    164

    Unanswered: Using ".Value" or not?

    Hi,

    I want to set the values of my controls on my form to a specific value.
    Both of the below methods work but I can't figure out the difference:

    Me!ContactID = Forms!frmContactPerson!ContactID
    Me!CompAdrsID = Me!CompAdrsList

    or

    Me!ContactID.Value = Forms!frmContactPerson!ContactID
    Me!CompAdrsID .Value= Me!CompAdrsList

    In addition I can't figure out the difference of using Me!Control and Me.Control?


    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    Me!CompAdrsID and Me!ContactID.Value are the same thing because access is defaulting to the .value command.

    The difference between '.' and '!' is that (and everyone please feel free to correct me here..) the '.' was used in earlier versions and now anything that you name (i.e. a form or control etc) should have a '!' between but it still accepts a '.'
    J.

  3. #3
    Join Date
    Nov 2002
    Posts
    150
    Originally posted by johncameron
    Me!CompAdrsID and Me!ContactID.Value are the same thing because access is defaulting to the .value command.

    The difference between '.' and '!' is that (and everyone please feel free to correct me here..) the '.' was used in earlier versions and now anything that you name (i.e. a form or control etc) should have a '!' between but it still accepts a '.'
    Close but... .Value is the default property of the item you are referencing so you do not need to specify it.

    The difference between '.' and '!' is tricky. '.' typically refers to items that are native to Access such as properties (value, backcolor, recordsource, etc.) while '!' typically refers to items created by a user such as the field ContactID.

Posting Permissions

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