Re: Me. vs Me!

From: solex (solex_at_nowhere.com)
Date: 06/04/04


Date: Fri, 4 Jun 2004 10:01:43 -0400

Derek,

Me always refers to the class period. Since your form is a class when ever
you refer to me you are point to the class. So if you have a control on
your form you would refer to the value of the control like this:

Me.MyControl.Value = "jfkldfj"

When you execute me.Refresh you are asking the form to refresh its
underlying datasource. So if you have controls that are based on other
controls your syntax would look something like this:

Private Sub cmb1_AfterUpdate()
    me.cmb2.Value = me.cmb1.Value
End Sub

"Derek Wittman" <anonymous@discussions.microsoft.com> wrote in message
news:167EEB96-E939-4612-92E1-C639EC692CD7@microsoft.com...
> Thanks, Dan. I have a small handful combo boxes that are based on one
another's values, so I use Me.Refresh in my AfterUpdate event procedures a
lot.
>
> But I can never get the Me. syntax to successfully represent a form
control's value...
>
> Thanks!
> Derek
>
> ----- solex wrote: -----
>
> Derek,
>
> First and foremost forms as fully qualified classes.
>
> I use the bang symbol "!" only when using the implicit objects such
as
> [Forms], [Reports] etc which represent a collection of other objects
in the
> property inspectors.
>
> You use the Me. syntax when refering to a property, subroutine or
function
> from within the class module.
>
> Regards,
> Dan
>
>
>
>
> "Derek Wittman" <anonymous@discussions.microsoft.com> wrote in
message
> news:AF58A59E-34D7-4FA2-A8F3-F639055A0BBA@microsoft.com...
> > Good morning,
> > I know I saw something in the last few days on this topic, but I
lost it.
> I continue to have to reference form controls like
> Forms!frmFORMNAME.controlname rather than (from form code)
Me!controlname or
> Me.controlname.
> >> I did some hunting in the help files and they suggest that the Me!
or Me.
> syntax may only be used in a class module (which I don't believe this
> qualifies as).
> >> Can someone please help me out?
> > Thank you!
> > Derek
>
>
>



Relevant Pages

  • Re: Me. vs Me!
    ... Dan ... > you refer to me you are point to the class. ... So if you have controls that are based on ...
    (microsoft.public.access.modulesdaovba)
  • Re: Refer to a tab control
    ... Controls on a tab control can be referenced via the main form's Controls ... > what is the syntax to refer to a text box located on a page of a tab ...
    (microsoft.public.access.formscoding)
  • Re: Calculating Sum of limited data set
    ... FormName is a collection of all the controls on that form. ... if what you want to refer to was named by ... Microsoft, it's a property and needs the dot, if you named it, ... use the bang. ...
    (microsoft.public.access.formscoding)
  • Re: New Thread - Pre Screening Questions for a C# developer
    ... The problem is that the questions lean to heavily on syntax ... but I'd stay away from syntactic trivia ... if you do WinForms work (of which I ... "How would you make the controls on your form resize ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Type Mismatch Error
    ... > found that syntax, ... recordsource, the relevant controls on the form, their controlsources, ... I need to understand that setup before I can give good ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)