Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Posts
    73

    Arrow Unanswered: How to use multiple OpenArgs?

    How do you use OpenArgs to send more than one variable to a report from a form. An example would be the RecordSource and the InpuParamters. I am only familiar with using OpenArgs once for the RecordSource..

    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238
    There are a number of ways of doing this, but you need to make yourself familiar with the string functions in VBA. For example you can pass through in the openargs property a string along the lines of:

    "Value_1;Value_2;Value_3"

    You would then use the Split function (see Help on how to use it) to split the string out using the ';' as the delimiter into an array.

    You could also use an openargs string like:

    "Name=Value_1;Description=Value_2;SQL=Value_3"

    With this you would need the other string functions available. If you have Access 97 Developer's Handbook (or any version of the book) there is an excellant routine in there that deals with this and makes it easy to use.

  3. #3
    Join Date
    May 2004
    Posts
    73
    I see,

    Is there anyway top adapt this code to tell the report the inputparameters?

    THE FORM:
    Private Sub Button_Click()
    DoCmd.OpenReport "RPT_RMA", acViewPreview,
    OpenArgs:="SP_ADVANCES_NOT_RECEIVED"
    End Sub

    THE REPORT:
    Private Sub Report_Open(Cancel As Integer)
    Me.RecordSource = "exec [" & Me.OpenArgs & "]"
    End Sub

    Any help would be appreciated.

    Thanks.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Access version??? Where are the input parameters? Why not pass those in also ...
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    May 2004
    Posts
    73
    M Owen,

    I am using Access 2003, and im trying to figure out how to THROW the inputparameters in with the recordsouce from the form.

  6. #6
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238
    If you are using SQL server 2000 as your back end you would be better off using a function or view to pass parameters and returning data. Stored procedures are better used for processing data rather then returning recordsets

    Justin

Posting Permissions

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