Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Location
    Texas
    Posts
    37

    Unanswered: What's the syntax for passing multiple string args to form

    What's the syntax for passing multiple string args to a form
    A2K - W2k
    Thanks & Regards
    Pete

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: What's the syntax for passing multiple string args to form

    Originally posted by pltx2000
    What's the syntax for passing multiple string args to a form
    What do you mean? Are you using the OpenArgs parameter of the OpenForm method? Access version?

  3. #3
    Join Date
    Jan 2004
    Location
    Texas
    Posts
    37
    My bad

    - Using the OpenArgs parameter of the OpenForm method -

    Is there another way? (don't want to use globals).


    I want to pass several "General Date" values to an "open form" sub from another form.

    I can go with strings and convert them in the target form but would prefer to just pass the Date values.


    Access 2000
    A2K - W2k
    Thanks & Regards
    Pete

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by pltx2000
    My bad

    - Using the OpenArgs parameter of the OpenForm method -

    Is there another way? (don't want to use globals).


    I want to pass several "General Date" values to an "open form" sub from another form.

    I can go with strings and convert them in the target form but would prefer to just pass the Date values.


    Access 2000
    OpenArgs is the best way ... Very portable then. Another method is to have a hidden textbox on the calling form and retrieve the parameter list from it from the called form ... What I do myself is stack the parameters up with divider tokens (usually commas - for numeric or date types) but I will also use the "pipe" character when passing strings. The format looks something like this:

    DoCmd.OpenForm "Purchase Request Allocations", , , , , , Me![Purchase Request Items].Form.ItemIDTxt.Value & "," & Me![Purchase Request Items].Form.QuantityTxt.Value

  5. #5
    Join Date
    Jan 2004
    Location
    Texas
    Posts
    37

    Thumbs up works

    I guess it's just too damn simple. This works.


    Dim SrcStr As String
    Dim CurStr() As String

    SrcStr = "02/15/2004 07:00:00AM , 02/02/2004 07:00:00AM"
    CurStr = Split(SrcStr, ",")

    MsgBox CurStr(0) & " , " CurStr(1)
    A2K - W2k
    Thanks & Regards
    Pete

Posting Permissions

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