display the selected records in the data report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • indrag91
    New Member
    • Nov 2006
    • 15

    display the selected records in the data report

    hai,
    i am using access database. Iam selecting few records based on a condition. For e:g select * from stud where avg>90 and placing these records in a multiselect list box. for e:g if there 10 records and i want to print any two selected records from the list box in the data report. How is it possible? Please help.

    thanks
    indra.
  • yogesh2522
    New Member
    • Dec 2006
    • 3

    #2
    Originally posted by indrag91
    hai,
    i am using access database. Iam selecting few records based on a condition. For e:g select * from stud where avg>90 and placing these records in a multiselect list box. for e:g if there 10 records and i want to print any two selected records from the list box in the data report. How is it possible? Please help.

    thanks
    indra.
    1) Create a temperory table fields are which you want to Place on data report
    2) cnn.Execute "Delete * from temporary Table Name"
    For i = 1 To lstvRegistratio n.ListItems.cou nt
    If lstvRegistratio n.ListItems(i). Selected = True Then
    j = j + 1
    If rs.State = 1 Then
    rs.Close
    End If
    rs.Open "select * from Registration where ID=" &
    lstvRegistratio n.ListItems(i). Text & "", cnn, adOpenStatic
    If rs.EOF <> True And rs.BOF <> True Then
    If rs.Fields(0) <> "" Then
    cnn.Execute "Insert into temp.Tbl Name Values (Fields which you
    want to place in Data report )"
    End If
    End If
    End If
    Next i

    After that you Simply Load report and show it.

    Comment

    • indrag91
      New Member
      • Nov 2006
      • 15

      #3
      Originally posted by yogesh2522
      1) Create a temperory table fields are which you want to Place on data report
      2) cnn.Execute "Delete * from temporary Table Name"
      For i = 1 To lstvRegistratio n.ListItems.cou nt
      If lstvRegistratio n.ListItems(i). Selected = True Then
      j = j + 1
      If rs.State = 1 Then
      rs.Close
      End If
      rs.Open "select * from Registration where ID=" &
      lstvRegistratio n.ListItems(i). Text & "", cnn, adOpenStatic
      If rs.EOF <> True And rs.BOF <> True Then
      If rs.Fields(0) <> "" Then
      cnn.Execute "Insert into temp.Tbl Name Values (Fields which you
      want to place in Data report )"
      End If
      End If
      End If
      Next i

      After that you Simply Load report and show it.


      yes,thanks is it possible without using temp tables and i want to select the records in a list box. is this possible.
      thanks
      indra

      Comment

      Working...