Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Posts
    48

    Unanswered: Field or Control Navigation

    In an Access database, when I close a pop-up window via a command button it returns to the field on the original form that triggered the pop-up window to open. What I would like to have happen is that when the pop-up closes, the focus is on a different field than the "triggering" field. I tried using "GotoControl" as part of an event procedure on the "closing" command button on the pop-up window. It bombed out. Can someone suggest the proper syntax to use?

    Startrekker, are you out there? You're usually very helpful.

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    use .SetFocus

    in the PopUps form's OnClose event put:

    Forms!OtherFormName.ControlName.SetFocus

    that other form of course must be open.....

  3. #3
    Join Date
    Aug 2004
    Posts
    48

    Field or Control Navigation

    NTC: Thank you for your suggestion. It both works and doesn't work and that is entirely my fault.

    I failed to mention that there are actually 3 forms. The pop-up form (I'll call it Form C) is triggered to open from data being entered on Form B which is a subform on Form A.

    The SetFocus procedure references Form B and then the Control Name. The system isn't recognizing the name of Form B. Is that because it's a subform of Form A? Does the syntax of the SetFocus procedure have to first reference Form A and then move to the subForm B and then the final desired Control?

  4. #4
    Join Date
    Oct 2009
    Posts
    340
    the syntax for a control on a subform is different:

    Forms!MainFormName.SubFormName.Form!ControlName.Se tFocus

  5. #5
    Join Date
    Aug 2004
    Posts
    48

    Field or Control Navigation

    Thanks NTC. Your suggestion works perfectly!

Posting Permissions

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