bsmith,

Yes, I'm running Crystal reports from the VB program. There are 2 option buttons (Same name, different indexes) in a form in order to allow the user tho choose which report he/she wants to see/print.

I've put your suggestion in this option button click event:

CrRepNext.ParameterFields(0) = TxtDateIni.Text
CrRepNext.ParameterFields(1) = TxtDateFin.Text

but I have received the following error message:
4830 object doesn't support this property or method.

When I see the list of properties for my Crystal reports object (CrRepNext or CrRepNext1), it doesn't show a property called "Parameter Fields". I must be doing something wrong, but I can't put my finger on it.

Thanks again for all of your help,
Roselene


This is the whole code for the event, in case you want to take a look:

Private Sub OptBtReports_Click(Index As Integer)
On Error GoTo ExecuteReportFail
Select Case Index
Case Is = 0
If DtReports1.Recordset.RecordCount = 0 Then
MsgBox "No data"
Else
CrRepNext.WindowState = crptMaximized
CrRepNext.ParameterFields(0) = TxtDateIni.Text
CrRepNext.ParameterFields(1) = TxtDateFin.Text
CrRepNext.PrintReport
Case Is = 1
If DtReports2.Recordset.RecordCount = 0 Then
MsgBox "No data"
Else
CrRepNext1.WindowState = crptMaximized
CrRepNext1.ParameterFields(0) = TxtDateIni.Text
CrRepNext1.ParameterFields(1) = TxtDateFin.Text
CrRepNext1.PrintReport
End if
End Select
Exit Sub
ExecuteReportFail:
MsgBox CStr(Err) + Error
' Resume OptBtReports_Click_Exit
End Sub