Results 1 to 6 of 6
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    diference between ! and dot (All)

    Right in the middle of a class and I can't think of an easy way to explain the difference between an explanation mark and the dot

    [forms]![form].[object]

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> I know they are going to ask and I always cock up the explanation... no pun intended <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

    Yours in great need
    Jerry

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: diference between ! and dot (All)

    As I remember from a previous class

    The ! separates objects and the . is added to show properties.
    I do not think that is strictly true now, but seems that is what I remember.


    Good Luck with the class.
    Richard

  3. #3
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: difference between ! and dot (All)

    Off the top of my head:-

    a splat ! denotes a member of a collection
    a dot denotes a property or method

    so Me!txtName denotes the txtName member of the controls colection of the form and Me.txtName denotes the 'property' of the form called txtName i.e. that textbox. The dot operator gives you Intellisense in the VBA IDE and also will cause a compile error if txtName's name is changed.

    HTH
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: diference between ! and dot (All)

    Thanks John et al

    This has been great. It all comes back to me.

    <John> excellent link but you will have to edit it (I think you may have put a space in it at the beginning)
    Jerry

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: diference between ! and dot (All)

    Jerry,

    In earlier versions of Acces it made a difference, and it still does in the query grid and when referencing members of the built in collections, but in 2000 and later, the two are largely interchangeable. The eclamation point, also referred to as the "bang", indicates a member of a collection, so Forms!MyForm indicates a member of the built-in Forms collection. A period, or "dot", indicates a method or property of an object, like Forms!MyForm.Name. It starts to get more confusing when you deal with things like controls on a form or report, because while they are members of the controls collection of that object, they also are treated as properties of the current object. That means that both Me!txtMyTextbox and Me.txtMyTextbox are valid in that context. That probably doesn't make it any clearer, of course. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: diference between ! and dot (All)

    Jerry

    Check out http:// http://www.access-programmers.co.uk/forums...ead.php?t=61539 for further discussion

    HTH, John

Posting Permissions

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