Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9189535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:15:31+00:00 2026-06-17T20:15:31+00:00

In Microsoft Access 2007 is it possible to manualy generate a RecordSet object and

  • 0

In Microsoft Access 2007 is it possible to manualy generate a RecordSet object and pass the object to a Microsoft Access Report and Sub Report?

I would like to have a Form, on which the user clicks a button and the OnClick event dynamically creates two RecordSets, opens a Report and attaches the first RecordSet to the Report and the second RecordSet to a SubReport on that Report. And then generates/shows the report.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:15:33+00:00Added an answer on June 17, 2026 at 8:15 pm

    You can set the Record Source of a form or a report to an SQL string. You can also filter a form or report based on an exiting query or table using the WHERE argument of OpenForm or OpenReport. Finally, you can set the recordset of a form to an existing Recordset, but that is slightly more complicated that just setting the Record Source to sql.

      sSQL = "SELECT [" & Me.AField & "] FROM [" & Me.ATable & "] " _
           & "WHERE [" & MeAnotherField & "] " & Me.Operator & Me.Value
    
      Forms!AnotherForm.Recordsource = sSQL
    

    Disconnected recordset

    Private Sub Form_Load()
    Set rs = New ADODB.Recordset ''CreateObject("ADODB.RECORDSET")
    
     With rs
        'Set .ActiveConnection = cn
        .LockType = adLockOptimistic
        .CursorType = adOpenKeyset
     End With
    
    'Create arrays from the lists
    asL1 = Split("a,b,c,", ",")
    asL2 = Split("b,e,c,d", ",")
    
    'Create a disconnected recordset
    rs.Fields.Append "Srt", adVarChar, 25
    rs.Fields.Append "L1", adVarChar, 25
    rs.Fields.Append "L2", adVarChar, 25
    
    rs.Open
    
    'Add list 1 to the recordset
    For i = 0 To UBound(asL1)
        rs.AddNew Array("Srt", "L1"), Array(asL1(i), asL1(i))
        rs.Update
    Next
    
    rs.Sort = "Srt"
    
    Set Me.Recordset = rs
    Set rs = Nothing
    Set cn = Nothing
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i dont have microsoft access but would like to open an mdb file, is
I have a form in Microsoft Access 2007 called System, and a combo box
In Microsoft Access 2007 under (Form View), how do you make text in a
I have a Microsoft Access form that is bound to a linked SQL Server
Is it possible to have an ODBC connection to a MS Access 2007 database
I tried to compress my Access 2007 database like this: System.Diagnostics.Process.Start(@C:\Program Files\Microsoft Office\Office12\msaccess.exe,@c:\Mydb.mdb /compact
I'm usually not working with Microsoft products. I have an MS Access 2007 project
We have an MS Access 2007 database with a simple form displaying table data.
I am currently developing an application in Microsoft Access 2007. Inside a form, I'd
Is it possible, in Microsoft Access 2007, to allow a user to select and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.