Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jul 2005
    Location
    Earth, New Jersey, USA
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prompt for All Records or A particular Customer (Access 2002)

    I have my report created but Now I want the report to prompt "Run for all customers" (leave blank ) or Enter Customer Name (run for that particular customer). Thanks in advance!

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Prompt for All Records or A particular Custome

    My standard solution for this problem is to launch the report from a form with an option group and a combo box.
    The option group has two options All Customers, Selected Customer.
    The combobox is initially hidden, but when you choose Selected Customer, the combo box becomes visible.

    In code you need to check that an appropriate selection has been made. (My example is about categories, rather than customers, but the idea is the same)

    If Me.optCategories = 2 And IsNull(Me.ComboCategory) Then
    MsgBox "Select a Category, or choose All Categories", vbInformation
    Exit Sub
    End If
    Attached Images Attached Images
    Regards
    John



  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Prompt for All Records or A particular Customer (Access 2002)

    An alternative is to use a parameter in the query that acts as record source for the report, either as a prompt [Enter Customer Name] or as a reference to a control on a form, e.g. [Forms]![frmParameters]![txtCustomer]. In the criteria row, enter

    [Enter Customer Name] Or [Enter Customer Name] Is Null

    or

    [Forms]![frmParameters]![txtCustomer] Or [Forms]![frmParameters]![txtCustomer] Is Null

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •