how to code depended queries as object's data source? Thanks

X

xpengi

Hi,

if i define some depended(crosstab) queriese in code, "query12
query13", then i want to set the form's record source is query13, ho
to do that?

i code as, but not work
...
dim defQuery as String
dim query12, query 13 as QueryDef

query12.SQL= "select.....from students...."
query13.SQL= "select.....from query12......"

defQuery = CurrentDb.QueryDefs(query13).SQL

Me.RecordSource = query13

' i pass the defined query to ADO function to query the database, the
get recordset object.
Call modADO.ConnectToThisDatabase
Call modADO.Students(modGlobal.curConn, modGlobal.rsRec
modGlobal.defQuery)
...
 
K

KARL DEWEY

Why not just open the form in Design view and set the Record Source. There
will be a pulldown to find tables and queries.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top