I need to filter records form a table to a form and have this SQL statement ONLoad event. It isn't working. Can someone help. Thanks.
Set rs = Currentdb.OpenRecordset("SELECT tblCorp19_1.CRM_Nbr, tblCorp19_1.[19_2 Status], Max(tblCorp19_1.revision) AS MaxOfrevision FROM tblCorp19_1 " & _
"GROUP BY tblCorp19_1.CRM_Nbr, tblCorp19_1.[19_2 Status] " & _
"HAVING (((tblCorp19_1.CRM_Nbr) Is Not Null) AND ((tblCorp19_1.[19_2 Status]) Is Null));"
Set rs = Currentdb.OpenRecordset("SELECT tblCorp19_1.CRM_Nbr, tblCorp19_1.[19_2 Status], Max(tblCorp19_1.revision) AS MaxOfrevision FROM tblCorp19_1 " & _
"GROUP BY tblCorp19_1.CRM_Nbr, tblCorp19_1.[19_2 Status] " & _
"HAVING (((tblCorp19_1.CRM_Nbr) Is Not Null) AND ((tblCorp19_1.[19_2 Status]) Is Null));"