Re: Opening report from a form field as parameter



Thanks Fred,
works good

Alain

"fredg" <fgutkind@xxxxxxxxxxxxxxx> wrote in message
news:tx9k4lnqfq9q.10f7bcssuv21x.dlg@xxxxxxxxxxxxx
> On Thu, 16 Jun 2005 13:35:59 -0400, Alain wrote:
>
>> 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
>
> The name of the report must be enclosed within quotes:
> DoCmd.OpenReport "rptRentRoll", acViewPreview
>
> I would also use the OpenReport's Where argument to filter the
> records, instead of setting the Report's Filter.
>
> If the Combo box bound column is Text (as indicated):
>
> DoCmd.OpenReport "rptRentRoll", acViewPreview, , "Division like '" &
> Me!cboDivision & "*'"
>
> No need to explicitly use the Value property as Value is the default.
> --
> Fred
> Please only reply to this newsgroup.
> I do not reply to personal email.


.



Relevant Pages

  • Re: Sending report about the current record in mail
    ... You can save the record by setting Dirty to False. ... >> filter so the report opens and is sent with just the record you need. ... Private Sub Report_Open ...
    (microsoft.public.access.forms)
  • Re: Search Filter for Report
    ... Private Sub cmdCreateReport_Click ... Allen Browne - Microsoft MVP. ... Limiting a Report to a Date Range ... That example applies the filter string to a form, ...
    (microsoft.public.access.formscoding)
  • RE: Create a Report using values form multiple combo boxes
    ... ' Check that the report is open ... ' Build criteria string for Department field ... ' Combine criteria strings into a WHERE clause for the filter ... Private Sub cmdRemoveFilter_Click ...
    (microsoft.public.access.reports)
  • Re: real time query parameters
    ... Dim strJerNum As String ... MsgBox "You must open the report first." ... ' Build Filter String ... Private Sub cmdRemove_Click ...
    (microsoft.public.access.queries)
  • Re: Sending report about the current record in mail
    ... > filter so the report opens and is sent with just the record you need. ... In the Open event of the report, apply the filter string, and then ... > Private Sub Report_Open ...
    (microsoft.public.access.forms)