Can anybody tell me how should i generate automatic sr no which match with mr no. i have written a code but it is not working properly.
Dim crystal As CRAXDDRT.Application
Dim Report As CRAXDDRT.Report
Dim cparam As CRAXDRT.ParameterFieldDefinition
Dim cparams As CRAXDDRT.ParameterFieldDefinitions
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Form_Load()
Call loadreport
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Zoom 100
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub
Private Sub loadreport()
Set con = New Connection
con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\asfserver\itp$\Product_tabletest.mdb")
'DataPath = "\\asfserver\itp$\Product_tabletest.mdb"
Set rs = New ADODB.Recordset
Set crystal = New CRAXDDRT.Application
Set Report = New CRAXDDRT.Report
rs.Open "select * from mr", con, adOpenDynamic, adLockOptimistic
Set Report = crystal.OpenReport(App.Path & "\" & "list2.rpt", 0)
End Sub