This is my querydef which works fantastically well,
I now need to change things slightly, but just cant get my head round this at the moment. I need to run the sql, but change the where statement to exclude the following Appointment: Treasurer, Secretary and Chairperson.
I have written a query which does just that, but I need to put this into a query def.
The sql of the query is below.
I have tried all sorts of things to make it work in the querydef but alas to no avail....yet. I can't work out the syntax
strSQL = "SELECT tblMembers.[Forename], tblMembers.[Surname], tblMembers.[Group], tblMembers.[Appointment], tblMembers.[Telephone], tblGroups.[Order], [Forms]![frmNoOfModules]![txtModule]" & _
"FROM tblMembers INNER JOIN tblGroups ON tblMembers.Group = tblGroups.Group " & _
"WHERE (((tblMembers.[Complete2]) Is Null));"
I now need to change things slightly, but just cant get my head round this at the moment. I need to run the sql, but change the where statement to exclude the following Appointment: Treasurer, Secretary and Chairperson.
I have written a query which does just that, but I need to put this into a query def.
The sql of the query is below.
SELECT tblMembers.Forename, tblMembers.Surname, tblMembers.Group, tblMembers.Appointment, tblMembers.Telephone, tblGroups.Order
FROM tblMembers INNER JOIN tblGroups ON tblMembers.Group = tblGroups.Group
WHERE (((tblMembers.Appointment)<>"treasurer" And (tblMembers.Appointment)<>"secretary" And (tblMembers.Appointment)<>"chairperson") AND ((tblMembers.Complete2) Is Null));
I have tried all sorts of things to make it work in the querydef but alas to no avail....yet. I can't work out the syntax