Re: Opening report from a form field as parameter



Thanks Duane,
just tried it and it still give me the same error
The Action or Method requires a ReportName Argument
at the docmd.openreport line

Alain

"Duane Hookom" <duanehookom@xxxxxxxxxxxxxxxxxx> wrote in message
news:OQ$6dspcFHA.412@xxxxxxxxxxxxxxxxxxxxxxx
> Consider changing your code to:
>
> Private Sub btnGenerateReport_Click()
> Dim strWhere as String
> If cboDivision.Value <> "" Then
> DataExchange.SetHeading cboDivision.Value
> strWhere = "[Division] like '" & Me.cboDivision & "*'"
> DoCmd.OpenReport rptRentRoll, acViewPreview, , strWhere
> DoCmd.Maximize
> Else
> MsgBox "Veuillez sélectionner une bannière de la liste déroulante."
> End If
> End Sub
>
> --
> Duane Hookom
> MS Access MVP
>
>
> "Alain" <abilodeau@xxxxxxxxxxxxx> wrote in message
> news:yCise.7691$Qr3.1030572@xxxxxxxxxxxxxxxxxxxxxxxx
>> Hi ,
>>
>> I would like to know on how to fix this problem when I open a report with
>> a criteria as a filter,
>> "The Action or Method requires a ReportName Argument" is showing at the
>> docmd.openreport
>>
>> Here is the code I use on my form
>> Private Sub btnGenerateReport_Click()
>> If cboDivision.Value <> "" Then
>> DataExchange.SetHeading cboDivision.Value
>> DoCmd.OpenReport rptRentRoll, acViewPreview
>> DoCmd.Maximize
>> Else
>> MsgBox "Veuillez sélectionner une bannière de la liste
>> déroulante."
>> End If
>> End Sub
>> and here is the code I use on my report
>> Me.FilterOn = True
>> Me.Filter = "Division like '" &
>> Forms!ReportGenerator!cboDivision.Value & "*'"
>>
>> TIA
>>
>> Alain
>>
>>
>
>


.



Relevant Pages

  • Re: Problem with Report code
    ... the report and Access changed the control source to this ... Duane Hookom ... Private Sub Report_Activate ... I have a main report with a number of subreports. ...
    (microsoft.public.access.reports)
  • Re: Extra detail format
    ... Thanks Duane, I have it working with the following code: ... Private Sub GroupFooter1_Print ... Dim sngTop As Long ... Dim rpt As Report ...
    (microsoft.public.access.reports)
  • Re: Opening report from a form field as parameter
    ... Alain ... >> Private Sub btnGenerateReport_Click ... >> and here is the code I use on my report ... > I would also use the OpenReport's Where argument to filter the ...
    (microsoft.public.access.reports)
  • Re: Error: Microsoft jet database engine does not recognize " as a va
    ... If you are attempting to create a crosstab report with dynamic columns, ... > Dim rstReport As DAO.Recordset ... > Dim intX As Integer ... > Private Sub Detail_Format ...
    (microsoft.public.access.reports)
  • Re: Error: Microsoft jet database engine does not recognize " as
    ... Report Propoerties window or would it need to be done through the VB code? ... >> ' Variables for Database object and Recordset. ... >> Dim rstReport As DAO.Recordset ... >> Private Sub Detail_Format ...
    (microsoft.public.access.reports)