G
Guest
I have this code :
Set Q = db.QueryDefs("qrySearch")
Q.sql = "SELECT qryEmployee.EmpID, qryEmployee.FirstName,
qryEmployee.LastName, qryEmployee.Country, qryEmployee.Region, " & _
"tblEmployee.RegionID FROM qryEmployee WHERE (((tblEmployee.RegionID) In ("
& Me.RegionSelected & ")));"
Q.Close
This is code from Allen Browne I believe.
This creates a query that allows multiple values to be passed to it - e.g
select all employees dependant on what region they are in - I can choose
multiple regions - this works fine.
What I need to know is if I also want to add additional fields to the query
when it is created based on multiple selections then what would the syntax be.
How do I add :
"tblCountry.CountryID FROM qryEmployee WHERE (((tblEmployee.CountryID) In ("
& Me.CountrySelected & ")))
I keep getting a syntax error.
I want to be able to then filter the query by Countries selected and then I
will want to do it by group etc. So essentially I am building a query based
on my selections in multi-select list boxes.
Set Q = db.QueryDefs("qrySearch")
Q.sql = "SELECT qryEmployee.EmpID, qryEmployee.FirstName,
qryEmployee.LastName, qryEmployee.Country, qryEmployee.Region, " & _
"tblEmployee.RegionID FROM qryEmployee WHERE (((tblEmployee.RegionID) In ("
& Me.RegionSelected & ")));"
Q.Close
This is code from Allen Browne I believe.
This creates a query that allows multiple values to be passed to it - e.g
select all employees dependant on what region they are in - I can choose
multiple regions - this works fine.
What I need to know is if I also want to add additional fields to the query
when it is created based on multiple selections then what would the syntax be.
How do I add :
"tblCountry.CountryID FROM qryEmployee WHERE (((tblEmployee.CountryID) In ("
& Me.CountrySelected & ")))
I keep getting a syntax error.
I want to be able to then filter the query by Countries selected and then I
will want to do it by group etc. So essentially I am building a query based
on my selections in multi-select list boxes.