hi malk,
I am giving the code as follows.
In frmmain select case for different types of reports.
Case REPORT_MINEPRODUCTS_BY_OWNER
Set objData = CreateObject("orderentry.clsMineProduct", g_intServerName)
blnSuccess = objData.getlistreport(rstData)
Set rptMainReport = appmain.OpenReport(AddDirSep(App.Path) & "rptMineProduct.rpt"

If rstData.RecordCount > 0 Then
For x = 1 To (rptMainReport.ParameterFields.Count)
Select Case rptMainReport.ParameterFields.Item(x).Name
Case "{?supplier}"
rstData.MoveFirst
If Not rstData.EOF Then
ReDim strstring(0)
strstring(0) = rstData("supplier"

rptMainReport.ParameterFields.Item(x).AddDefaultValue (""

rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("supplier"

)
For y = 1 To rstData.RecordCount
For z = 0 To UBound(strstring())
If strstring(z) = rstData("status"

Then
blnexists = True
End If
Next
If blnexists = False Then
rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("Supplier"

)
ReDim Preserve strstring(UBound(strstring()) + 1)
strstring(UBound(strstring())) = rstData("status"

End If
blnexists = False
rstData.MoveNext
Next
End If
Case "{?Product Status}"
rstData.MoveFirst
If Not rstData.EOF Then
ReDim strstring(0)
strstring(0) = rstData("status"

rptMainReport.ParameterFields.Item(x).AddDefaultValue (""

rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("status"

)
For y = 1 To rstData.RecordCount
For z = 0 To UBound(strstring())
If strstring(z) = rstData("status"

Then
blnexists = True
End If
Next
If blnexists = False Then
rptMainReport.ParameterFields.Item(x).AddDefaultValue (rstData("Status"

)
ReDim Preserve strstring(UBound(strstring()) + 1)
strstring(UBound(strstring())) = rstData("status"

End If
blnexists = False
rstData.MoveNext
Next
End If
End Select
Next
End If
rptMainReport.Database.SetDataSource rstData
there are two parameters supplier and product status.when i run the report i get parameters popup and if I enter the parameters and then click on ok button ,i get the report.if click on cancel button ,i get the message 'user cancelled' .if click on ok the frmreport form is blank.i want the frmreport form shoud be unloaded and the control should goes to main menu form.
thanks
ven