Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    178

    Unanswered: What is OpenArgs?

    Hi,

    Can someone please explain to me what OpenArgs does? in a simple manner and/or give an example?

    Thanks to anyone who can help.

    ~Aboo

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Sure. I can.

    In VBA when you open a form, you can open it and pass a value to it at the same time with:

    Docmd.OpenForm "FormName", SomeValue

    The SomeValue here is the "Open Argument" or OpenArg.

    Then, in the form that you are opening, it would also have some VBA in it that acts on the value... perhaps setting a filter:

    Me.Filter = "CustomerName = " & Me.OpenArgs

    Get it?

    * Syntax is not correct, in order to keep it simple.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    May 2006
    Posts
    178
    Thankyou L33t Helper Munky,

    Is it possible to pass more than one value? for example, u want to pass values of 2 Text boxes? If so what would the syntax be?

    Aboo

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You can't pass them with OpenArgs separately, but you could pass a text string such as 12,5 and your OpenArgs process would then need to deal with acting on the variable contents contained within the string.

    Another way you could do it is thus:

    Form1 has a button to call up Form2. Form2 examines the contents of Form1 directly, without passing of any variable, by using syntax such as Form1!ObjectName etc.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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