Graphic

  • Thread starter Thread starter Fadoyo
  • Start date Start date
F

Fadoyo

Hi all, please I have a report with a graphic. Now the query is built under
design, but I would like to build the query filtered between two querys. How
could I do it with code?

Thanks
Fadoyo
PD: Please, I need help!!!
 
Fadoyo said:
Hi all, please I have a report with a graphic. Now the query is built under
design, but I would like to build the query filtered between two querys. How
could I do it with code?

In code, you'd do it like the following, but it whill only work once unless
you delete the queries that you create:

Function testit()
Dim qd1 As DAO.QueryDef
Dim qd2 As DAO.QueryDef
Dim qd3 As DAO.QueryDef

Set qd1 = CurrentDb.CreateQueryDef("qry1", "Select * From Table1")
Set qd2 = CurrentDb.CreateQueryDef("qry2", "Select * From Table2")

Set qd3 = CurrentDb.CreateQueryDef("qry3", "SELECT qry2.Whatever FROM qry1
INNER JOIN qry2 ON qry1.IDField = qry2.IDField;")


DoCmd.OpenQuery "qry3"

End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top