going to report view from form view

G

Guest

hello

in my data base I have used VB code for searching and viewing my records
in form view like this:

DoCmd.OpenForm "frmDocumentSummary", WhereCondition:=varWhere

now I want to print this result in report view, so I have made one buttom
and event procedure

to that like this:

DoCmd.OpenReport "rptDocumentSummary", acPreview, WhereCondition:=varWhere

(the same wherecondition)

but i don't know how i have to do that?

MY wherecondition in report view does not work and it returns all the
records in report view

Thanks in advanced.
 
C

Carl Rapson

Masoud said:
hello

in my data base I have used VB code for searching and viewing my records
in form view like this:

DoCmd.OpenForm "frmDocumentSummary", WhereCondition:=varWhere

now I want to print this result in report view, so I have made one buttom
and event procedure

to that like this:

DoCmd.OpenReport "rptDocumentSummary", acPreview, WhereCondition:=varWhere

(the same wherecondition)

but i don't know how i have to do that?

MY wherecondition in report view does not work and it returns all the
records in report view

Thanks in advanced.

Have you tried putting the WhereCondition in its normal place in the
parameter list?

DoCmd.OpenReport "rptDocumentSummary", acPreview,, varWhere

Is the report based on exactly the same query/table as the form? If not, the
WHERE clause may not be correct for the report's Record Source.

Carl Rapson
 

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