going to report view from form view

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top