Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    240

    Unanswered: SetFocus using OpenArgs

    Hi,

    I've come across a problem in my application where when I close my search form to go back to the previous form, the Main Menu form seems to load on top of this form every time.

    Since I will have more than one form opening the seach form to close them I have had to use the OpenArgs property to set the Form.Name in the DoCmd.OpenForm

    To get round this problem I can use the SetFocus to set the previous form to display on top rather than the Main Menu form, but can I use the OpenArgs property as the form's name for SetFocus?

    If so, how?

    Thanks

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    You could pass the form name to the search form as an openarg in the same code that you're opening the search form with. Then set the focus back to that form in the search form closing code.

    You may want to look into why your main menu insists on being the center of attention. I've never run arcross that problem and am curious.

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Perhaps your main form is set to be "Popup".

    Also, I tend to close any form not in use. Is it necessary for your main form to remain open?

  4. #4
    Join Date
    Sep 2005
    Posts
    240
    Thanks, I've managed to sort this problem out now.

    None of my forms were set to 'PopUp' apart from the search form.
    But I realised I could set acDialog to the WindowMode property in the OpenForm Method to set it as a popup form, which seems to have worked.

Posting Permissions

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