Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Who Opend the Form?? (A2k (9.0.3821) SR-1)

    When opening a form from a custom menu is there any way to set a from open argument so in the form open event code can determine if the form was opened by the user from the menu or developer from the database container?

    Thanks, John

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Who Opend the Form?? (A2k (9.0.3821) SR-1)

    When you open the form from the custom menu you can use the openargs argument to pass the username to the form:

    DoCmd.OpenForm stDocName, acNormal, , , , , CurrentUser

    The form can use this data by looking at its openargs property.

    If the form is opened from the db window the openargs property would be null.
    Regards
    John



  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Who Opened the Form?? (A2k (9.0.3821) SR-1)

    As recommended you can use OpenArgs to identify how form was opened. A small sample db (A2K format) is attached illustrating how this would work. When form opens, label indicates which method was used to open form.

    HTH
    Attached Files Attached Files

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Who Opened the Form?? (A2k (9.0.3821) SR-1)

    Thanks John & Mark

    This is what's great about the forum, two ways to skin the cat.

    A picture is worth hours of trial & error

    Thanks, John

Posting Permissions

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