Results 1 to 7 of 7
  1. #1
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112

    Where can I get more information on this pls?

    Hi,


    I am looking at the VB code of an Access project, and one line of the code says:

    Dim strWhere As String
    strWhere = "[SrvID] = " & Me![SrvID]

    I searched Help and found the documentation for the implicit variable "Me".

    However, where can I learn more about what Me![SrvID] means or what it refers to? What does the "!" character do, and what do I search to find more info on it?

    I tried searching Me![SrvID] but nothing came up.

    Thanks.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Me is shorthand for Forms.YourFormName which as you can see is a reference to the current form. "!" is shorthand for the default collection which is the Controls collection in tha case of a Form. In your case the Me![SrvID] in long hand would be: Forms.YourFormName.Controls.SrvID replacing YourFormName with your actual form name of course. SrvID is a ControlName on your form and (here's where it gets a little tricky) if there is no Control on your form named SrvID then Access will point to a Field in your RecordSource named SrvID. Clear as mud, right?

  3. #3
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112
    Thanks! If I wanted to read the documentation on this on Access Help, what should I search for? Not on "Me" but on the "!" shorthand.

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I want to know what are the differences between "!" and "."

    I always use "." and never use "!" except in DAO.recordset because I can't use "." to get recordset's field. But I use only "." in form's controls.

    Is there any difference between me.SrvID and me!SrvID?

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  6. #6
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Very good article, helpful.
    Thank you RuralGuy.

  7. #7
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112
    Yes, thanks for coming through again RuralGuy!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Information transfer
    By tomclavil in forum Forms
    Replies: 5
    Last Post: 02-07-2011, 05:41 AM
  2. Changing information orientation
    By gumberculies in forum Reports
    Replies: 1
    Last Post: 06-10-2010, 07:48 PM
  3. Updating information in the tables
    By jamilian in forum Database Design
    Replies: 1
    Last Post: 02-17-2010, 08:46 AM
  4. Crosstabbing Information
    By crashz in forum Queries
    Replies: 2
    Last Post: 06-25-2009, 08:45 AM
  5. Alphabetize Information
    By caljohn527 in forum Forms
    Replies: 1
    Last Post: 02-11-2009, 10:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums