Setting sourceobject for subform

N

navin

Hi,

I am trying to set the sourceobject of an unbound subform which is a
query.

Below is the code:

sqldetails = "SELECT Round(count(Requisition)/21) AS ARPD, Round(count
(Requisition)/5.5) AS ARPB, round(ARPD/5.5) AS ARPBD " _
& "FROM tblPOData;"

" Form_frmReports.subRequisitionDetails.SourceObject = sqldetails "

However, on the above line, i get this error: "The Form name you
entered does not follow object naming rules.

When i try to use Form_frmReports.subVolumeCoun.Form.RecordSource =
sqlRdetails for the subform i am getting error that, the object is
closed.

Is it not possible to set a sourceobject for a subform through a
query?

Please help....

Thanks in advance.

Navin
 
D

Douglas J. Steele

Try:

Forms!frmReports!subVolumeCoun.Form.RecordSource = sqldetails

Of course, form frmReports must be open before you can do this.
 

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