By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,071 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,071 IT Pros & Developers. It's quick & easy.

display the selected records in the data report

P: 15
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.
Dec 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: 3
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 lstvRegistration.ListItems.count
If lstvRegistration.ListItems(i).Selected = True Then
j = j + 1
If rs.State = 1 Then
rs.Close
End If
rs.Open "select * from Registration where ID=" &
lstvRegistration.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.
Dec 12 '06 #2

P: 15
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 lstvRegistration.ListItems.count
If lstvRegistration.ListItems(i).Selected = True Then
j = j + 1
If rs.State = 1 Then
rs.Close
End If
rs.Open "select * from Registration where ID=" &
lstvRegistration.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
Dec 12 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.