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

  • Home
  • SEARCH
  • 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 9201557
In Process

The Archive Base Latest Questions

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

Private Sub showreport_Click() sql = select * from student_record_database where sql=sql+ Grade=’ & Combo1.Text

  • 0
Private Sub showreport_Click()
    sql = "select * from student_record_database where"
    sql=sql+ Grade='" & Combo1.Text & "' AND Meal='" & Combo11.Text & "'"
    Set RES = CON.Execute(sql)
    Set DataReport1.DataSource = RES
    DataReport1.WindowState = vbMaximized
    DataReport1.Show vbModal
End Sub

I am using this code as record set to create a data report.

  1. My task is to choose options from various combo boxes and then display it’s report so record set is needed there..

  2. My question is that whether this code is sufficient to create data report???

  3. I didn’t set any properties of data environment or data report such as (connection – command – sql) because I am passing this record set directly to data report,then no need to fire any sql in properties of data environment.

But unfortunately it is not showing desired output
Please help me.

  • 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-17T23:02:33+00:00Added an answer on June 17, 2026 at 11:02 pm

    Try this one:

    Private sub cmdprint_click()
    
    Dim rs as new adodb.recordset
    
    rs.open "SQL Query Statement Here",CON, adOpenDynamic, adLockOptimistic
    
    set datareport1.datasource=rs
    datareport1.show
    
    end sub
    

    Notes:
    The data report datasouce should be cleared during design mode. (See properties on the datareport and set its datasource property to empty.) Ohhh…one more thing, please keep in mind that you should set also the datafield property for each textbox object inside the datareport corresponding to the datafield on your database during design time…

    I am using this method for a long time and it works fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Private Sub Text46_AfterUpdate() Dim strSource2 As String strSource2 = SELECT [Product Code],[Stock Level],[Description] FROM
Private Sub sendemail(esubj) Sheets(Actual).Select myfridate = Cells(1, 3).Value myfridate = DateAdd(d, -2, myfdate) myfridate
Private Sub CommandButton1_Click() Dim rng As Range Dim cell As Variant Set rng =
Private Sub Form_Open(Cancel As Integer) Me.Bathroom = Forms!frmBathrooms!ID Me.txtBathInfo.Caption = Bathroom Room Number: &
Private Sub FKeyButton_Click(Index As Integer) Dim curChild As Form Set curChild = frmMain.ActiveForm Dim
Private Sub framePDF_MouseMove(ByVal... ) framePDF.BackColor = &H80000012& So, the frame's color is changing. I
Private Sub Worksheet_Change(ByVal Target As Range) Dim r1 As Range Set r1 = Range(A1:B10)
Private Sub Form_Current() Dim bytoffcut As Byte Dim strCriteria strCriteria = [WOID] = &
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If txtSubd.Text
so Private Sub Worksheet_Change(ByVal Target As Range) Dim KeyCells As Range Set KeyCells =

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.