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...

VB Code:
  1. d = Date
  2.    strGroupSQL = "SELECT * FROM tblContact "
  3.    
  4.    strDetailsSQL = "SELECT tblContact.ID, tblContact.Name, tblTransaction.Total, tblTransaction.TransID, tblTransaction.Paid, tblTransaction.Total, "
  5.    strDetailsSQL = strDetailsSQL & "tblTransaction.Total - tblTransaction.Paid AS Balance ,tblTransaction.DueDate, tblTransaction.Settled "
  6.    strDetailsSQL = strDetailsSQL & "FROM tblContact Where tblContact.ID IN (Select Distinct tblTransaction.ID from tblTransaction WHERE tblTransaction.Settled LIKE 0 AND tblTransaction.DueDate like " & d & ")"
  7.      
  8.    strShapeSQL = "SHAPE {" & strGroupSQL & "} "
  9.    strShapeSQL = strShapeSQL & "APPEND ({" & strDetailsSQL & "} AS GrpDetails "
  10.    strShapeSQL = strShapeSQL & "RELATE ID to ID) "