Passing the value of ActiveControl to Unbound Text Box

Discussion in 'Access Forms Coding' started by magmike, Jul 16, 2012.

  1. magmike

    magmike Guest

    Similar to the address bar in Excel, I am trying to display the value of the currently entered form field in a Continuous Form in an Unbound Text Box in the Form Header. Here is how I unsuccessfully atempted it:

    In the form's OnCurrent Event:

    Me.FieldValueDisplay.Value = Me.ActiveControl

    What I get on Form Load is an error stating that "The expression you entered requires the Control to be in the active window." After ending the event,tabbing through the fields has no effect, but clicking on them does. Of course, I want the event to work correctly whether clicking into a new field or tabbing into a new field, without having to do an event in each form field (if possible).

    Any ideas?

    Thanks!

    magmike
     
    magmike, Jul 16, 2012
    #1
    1. Advertisements

  2. I haven't time and energy to look it up (taking a last look even though it's
    past my beddybyetime), but isn't ActiveControl a property of the Screen
    object? As coded, you are referring to it as a property of the Form object.

    --
    Larry Linson
    Microsoft Office Access MVP
    Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

    "magmike" <> wrote in message
    news:...
    Similar to the address bar in Excel, I am trying to display the value of the
    currently entered form field in a Continuous Form in an Unbound Text Box in
    the Form Header. Here is how I unsuccessfully atempted it:

    In the form's OnCurrent Event:

    Me.FieldValueDisplay.Value = Me.ActiveControl

    What I get on Form Load is an error stating that "The expression you entered
    requires the Control to be in the active window." After ending the event,
    tabbing through the fields has no effect, but clicking on them does. Of
    course, I want the event to work correctly whether clicking into a new field
    or tabbing into a new field, without having to do an event in each form
    field (if possible).

    Any ideas?

    Thanks!

    magmike
     
    Access Developer, Jul 16, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. 1
    Replies:
    0
    Views:
    209
  2. MarkD

    "General" activecontrol.dropdown function?

    MarkD, Jan 13, 2005, in forum: Access Forms Coding
    Replies:
    3
    Views:
    171
    PC Datasheet
    Jan 14, 2005
  3. n1mbus

    help with ActiveControl method

    n1mbus, Sep 19, 2005, in forum: Access Forms Coding
    Replies:
    4
    Views:
    93
    n1mbus
    Sep 19, 2005
  4. Leif

    ActiveControl in Form View

    Leif, Jan 9, 2006, in forum: Access Forms Coding
    Replies:
    3
    Views:
    279
    Marshall Barton
    Feb 27, 2006
  5. JotKa

    Anomality with ActiveControl property?

    JotKa, May 3, 2006, in forum: Access Forms Coding
    Replies:
    2
    Views:
    112
    JotKa
    May 3, 2006
  6. mcnews
    Replies:
    2
    Views:
    71
    Brendan Reynolds
    Sep 14, 2006
  7. VRakesh
    Replies:
    5
    Views:
    247
    Larry Linson
    Jan 22, 2010
  8. Hugh self taught

    Cancel button's ActiveControl reflects as value of text box

    Hugh self taught, Jan 28, 2010, in forum: Access Forms Coding
    Replies:
    6
    Views:
    136
    Hugh self taught
    Jan 30, 2010
Loading...