Printing Selected Record In Data Report VB 6

Submitted by micca.jhai on
Can someone help me? I'm having trouble displaying filter records in data report. I'm trying to print the selected records by date using filter, but when I print it, all the data in database are display instead of the selected one. Can someone help me? Thank you. Here is my code:
  1. Private Sub Command3_Click()
  2.  
  3. On Error Resume Next
  4. DataEnvironment1.rsCommand1.Open "select * from patients where ID & Lastname & Givenname & DateNow = ''"
  5.  
  6. DataReport4.Refresh
  7.  
  8. DataReport4.Show
  9.  
  10. DataEnvironment1.rsCommand1.Close
  11. End Sub