Results 1 to 5 of 5
  1. #1
    manic is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    63

    OpenArg help.

    Can anyone look at this code and let me know how I can use it to pass more than two values to a form from another. this is what I have on form1
    Code:
    DoCmd.OpenForm "frm_safety_investigation", , , , , , Me![Incident_Number] & "," & Me![Employee_Involved_1]
    and on form 2 on the load event i have this



    Code:
    Private Sub Form_Load()
    If Not IsNull(Me.OpenArgs) Then
    Incident_Number = Left(Me.OpenArgs, InStr(Me.OpenArgs, ",") - 1)
    Corrective_Action_Number = Left(Me.OpenArgs, InStr(Me.OpenArgs, ",") + 1)
    end if
    end sub
    but I can't figure out to save my life how to make it pass more than just two fields with the openarg method.
    any help would be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I should add that you can loop the array resulting from the Split() function if there will be a variable number of items passed.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    manic is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    63
    Thank you , you solved my issue.

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. passing openArg to a listbox on other form
    By focosi in forum Access
    Replies: 7
    Last Post: 08-12-2011, 04:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums