| re: Form-Query-Report
Andy wrote:[color=blue]
> Hopefully an easy one?
>
> Have created a Form with numerous ComboBoxes.
> On hitting OK on the form this calls up a Query which has all the[/color]
criteria[color=blue]
> "links" to my Form. All works OK.
> How do I call up a Report (which looks better)that is displayed on[/color]
the[color=blue]
> screen or that can be printed.
>
> Andy[/color]
Umm... yeah. The help file is your friend. If not, introduce
yourself.
One example...
Private Sub cmdOpenTransactionReport_Click()
On Error GoTo Err_cmdOpenTransactionReport_Click
Dim stDocName As String
Dim strCriteria As String
stDocName = "rptTransaction"
'build your filter here...
strCriteria = "TransDate=#" & Me.TransDate & "#"
'open filtered report with criteria string
DoCmd.OpenReport stDocName, acPreview, , strCriteria
Exit_cmdOpenTransactionReport_Click:
Exit Sub
Err_cmdOpenTransactionReport_Click:
MsgBox Err.Description
Resume Exit_cmdOpenTransactionReport_Click
End Sub
Note, the wizard will do most of this for you. All you need to do is
build the valid WHERE clause yourself and modify the OpenReport
statement. |