i tried to run this statement but i got some errors...can someone show me how to do this correctly? i want to filter my employee records showing only the records with equivalent transactions on a given date...i mean i want to suppress my records displaying only those records with transactions that corresponds to a certain date... ??

VB Code:
  1. Dim strGroupSQL As String
  2. Dim strDetailsSQL As String
  3. Dim strShapeSQL As String
  4. Dim cus As String
  5. Dim d As Date
  6.  
  7.    d = Date
  8.    strGroupSQL = "SELECT ID, Name FROM tblContact WHERE ID IN (SELECT DISTINCT tblTransaction.ID FROM tblTransaction)"
  9.    
  10.    strDetailsSQL = "SELECT tblContact.ID, tblContact.Name, tblTransaction.Total, tblTransaction.TransID, tblTransaction.Paid, tblTransaction.Total, "
  11.    strDetailsSQL = strDetailsSQL & "tblTransaction.Total - tblTransaction.Paid AS Balance ,tblTransaction.DueDate, tblTransaction.Settled "
  12.    strDetailsSQL = strDetailsSQL & "FROM tblContact INNER JOIN tblTransaction ON tblContact.ID = tblTransaction.ID WHERE tblTransaction.Settled LIKE 0 "
  13.    
  14.    strShapeSQL = "SHAPE {" & strGroupSQL & "} "
  15.    strShapeSQL = strShapeSQL & "APPEND ({" & strDetailsSQL & "} AS GrpDetails "
  16.    strShapeSQL = strShapeSQL & "RELATE ID to ID) "