Re: how to print data from datagrid using datareport?
Posted 21 February 2011 - 02:41 AM
Before you apply the code you should make first or add data report. Then put a rpttexbox in details section. If how many fields you want to display from the database then copy the field in the database and paste in in rpttextbox datafield in properties.
Private Sub Command1_Click()
Dim searchcon As New ADODB.Recordset
searchcon.CursorLocation = adUseClient
searchcon.Open "Select * from rotcgrades where ID_No ='" & search.Text & "'", con, adOpenForwardOnly, adLockOptimistic
Set rptindividualstudent.DataSource = searchcon
Set searchcon = Nothing
This post has been edited by macosxnerd101: 21 February 2011 - 08:51 AM
Reason for edit:: Please use code tags