Re: Refer to itself



Hi, John.

I think I misunderstood your question. You aren't looking to hard code the
control's name. In that case, follow Allen Browne's good advice.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.


"'69 Camaro" <ForwardZERO_SPAM.To.69Camaro@xxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:5PPLi.328$0I5.63@xxxxxxxxxxx
Hi, John.

I want to refer to that field's value. What's the easiest way to refer to
that field's value?

To avoid bugs, circular references, et cetera, change the name of the
control bound to the field from the field's name (which is the default
when Access creates the bound control) to something else, such as
txtInvoiceAmount, instead of InvoiceAmount. Example VBA syntax:

variableName = Me!ControlName.Value

or

variableName = Me.ControlName.Value

st = Me (which doesn't work).

In this case, Me refers to the form itself.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.


.



Relevant Pages

  • Re: Refer to itself
    ... To avoid bugs, circular references, et cetera, change the name of the ... control bound to the field from the field's name (which is the default when ... variableName = Me!ControlName.Value ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ...
    (comp.databases.ms-access)
  • Re: Access 2007 - Security
    ... See http://www.QBuilt.com for all your database needs. ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com ...
    (microsoft.public.access.security)
  • Re: Workgroup file has disappeared?
    ... See http://www.QBuilt.com for all your database needs. ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com ...
    (microsoft.public.access.formscoding)
  • Re: Database Options - Any other settings I should adjust?
    ... See http://www.QBuilt.com for all your database needs. ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com ...
    (comp.databases.ms-access)
  • Re: global search of the MSysQueries table
    ... See http://www.QBuilt.com for all your database needs. ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com ...
    (comp.databases.ms-access)