shirishdawane,

Sorry, I am sleepy. Here is the correct code.

VB Code:
  1. [B]CRreport.DiscardSavedData[/B]
  2.  
  3.         frmreport.CRreport.Connect = DE.Connection1
  4.         frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
  5.         str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
  6.         frmreport.CRreport.Destination = crptToWindow
  7.         frmreport.CRreport.WindowParentHandle = frmreport.hWnd
  8.         frmreport.CRreport.SelectionFormula = str
  9.         Screen.MousePointer = Default
  10.         frmreport.CRreport.Action = 1