Results 1 to 2 of 2
  1. #1
    darshita is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2009
    Posts
    9

    Recordsource with Multiple queries

    Hi,



    I am parsing OpenAgrs as a String From "Form" To Report.

    DoCmd.OpenReport "table", acViewPreview, , , acWindowNormal, sTemp

    sTemp ( OperArgs) is in a form of string which are "Name" field values selected from Form ListView.

    Now, Report side:

    Dim args As Variant

    Private Sub Report_Open(Cancel As Integer)

    Dim temp As Variant
    Dim qry As String

    If Not IsNull(Me.OpenArgs) Then

    temp = Split(Me.OpenArgs, ",")

    qry = "SELECT * FROM tblSample WHERE Name = " & "'" & CStr(temp(0)) & "'" & ";" & union & "SELECT * FROM tblSample WHERE Name = " & "'" & CStr(temp(1)) & "'" & ";"

    Me.RecordSource = qry

    End If
    End Sub

    I am spliting string parsing from Form Side, to get all Name values.
    Query to set recordset is to get all records from table where Name are equal to all selected values from that listview. I have done by this way.
    But it only gives me very first selected Name Record.

    Help ME!

    Thank You,
    Darshi.

  2. #2
    darshita is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2009
    Posts
    9
    well...i forget to mension that "qry" i have written here:

    Just to check whether it does work for any two selected values : temp(0) , temp(1).

    But i want to do it for all selected values.

    Thanks,
    Darshi.

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

Similar Threads

  1. ADO.Recordset - Write
    By Marvin in forum Programming
    Replies: 0
    Last Post: 07-17-2009, 07:56 AM
  2. Help writing multiple queries
    By wz72n01 in forum Queries
    Replies: 1
    Last Post: 05-24-2009, 12:30 PM
  3. Replies: 1
    Last Post: 06-21-2007, 01:02 PM
  4. Replies: 0
    Last Post: 06-07-2007, 02:33 PM
  5. Replies: 0
    Last Post: 03-19-2006, 11:52 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