Results 1 to 2 of 2
  1. #1
    Join Date
    May 2010

    Unanswered: "Me" Reference not working?!


    I have never been able to use the Me reference to refer to an active form. Here is what I get in the Immediate window when I try to print the value of my combo box control:

    debug.Print Forms!Form1.Ctype.Value
    *Returns Value*
    debug.Print Me!Ctype.Value
    *Returns error Pop up- Compile Error: Variable not yet created in this context.*

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    If you use Me within your form's code module I suspect you'll find that it does, indeed work.

    Me. can only be used to reference the current form from within the code module for that form, and the Immediate Window is not part of that code module! It is a separate entity, for testing code.

    To prove this
    1. Place your debug.Print Me!Ctype.Value statement in the Immediate Window
    2. Close your form
    3. Now go to Modules
    4. Open any module, or if you have none, click on Design
    You will now see the Immediate Window with your

    debug.Print Me!Ctype.Value

    statement still intact. The Immediate Window is independent of this module as well.
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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