Results 1 to 2 of 2

Thread: Single record in a report

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2007
    Posts
    35

    Single record in a report

    Hi,
    How can i make my report show only one record? and how can i make it show only the records that have the same value in one particular field?

    Im using vb6 with ms access.

    thanks

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: Single record in a report

    Try parameters see a sample code below
    VB Code:
    1. Dim appln As New CRAXDDRT.Application
    2. Dim report As New CRAXDDRT.report
    3. Dim rep As New frmRptRegionIndividual
    4. Public comboText As String
    5. Public comboItemData As Integer
    6. Private Sub Form_Load()
    7. Me.MousePointer = vbHourglass
    8.  
    9. Set report = appln.OpenReport(App.Path & "\ReportsManual\regionwiseIndividual.rpt")
    10. report.Database.Tables(1).Location = App.Path & "\Database\Cases.mdb"
    11. report.ParameterFields.GetItemByName("RgnID").AddCurrentValue (comboItemData)
    12.  
    13. CRViewer91.ReportSource = report
    14. CRViewer91.ViewReport
    15. Me.MousePointer = vbDefault
    16.  
    17. End Sub
    18.  
    19. Private Sub Form_Resize()
    20. CRViewer91.Top = 0
    21. CRViewer91.Left = 0
    22. CRViewer91.Height = ScaleHeight
    23. CRViewer91.Width = ScaleWidth
    24. End Sub
    In the above Iam using combobox to determine the selection criteria and pass it to the parameter created in the report. note the combo is in another form and I am capturing it by a public variable "comboText".
    Hope u find it useful.

Posting Permissions

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



Click Here to Expand Forum to Full Width