Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can I Do This in Report? ( A2k (9.0.4402) SR-1)

    Can I Do This in Report?

    A2k (9.0.4402) SR-1

    I have a report that prints the operator entered date range in the report page header

    The Text Box: DateHeader control source is as follows:

    =[Forms]![frmCriteriaHP]![txtDateType].[Caption] & " " & [Forms]![frmCriteriaHP]![txtStartDate].[Caption] & " Thru " & [Forms]![frmCriteriaHP]![txtEndDate].[Caption]

    This works fine when operator enters Start and End Dates,

    Date Range: 01/01/2002 Thru 01/31/2002

    However if date range is not entered (which is OK) Thru prints by itself.

    Date Range: Thru

    Is there a way to wrap an If statement around the control source to test txtStartDate and txtEndDate for no date range and print None instead of Thru?

    Date Range: None

    Command syntax would be helpful.

    Thanks, John Graves

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can I Do This in Report? ( A2k (9.0.4402) SR-1)

    Sure, just put an IIF statement in there.

    For example,
    =[Forms]![frmCriteriaHP]![txtDateType].[Caption] & " " & [Forms]![frmCriteriaHP]![txtStartDate].[Caption] & IIF(txtStartDate="",""," Thru ") & [Forms]![frmCriteriaHP]![txtEndDate].[Caption]

  3. #3
    Star Lounger
    Join Date
    Sep 2001
    Location
    Pleasanton, California, USA
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can I Do This in Report? ( A2k (9.0.4402) SR-1)

    This can be done more elegantly by including the "thru" in a package with the end date:

    =[Forms]![frmCriteriaHP]![txtDateType].[Caption] & " " & [Forms]![frmCriteriaHP]![txtStartDate].[Caption] & <font color=red>(</font color=red>" Thru " <font color=red>+</font color=red> [Forms]![frmCriteriaHP]![txtEndDate].[Caption]<font color=red>)</font color=red>

    Now the "thru" won't print unless the end date is entered.

Posting Permissions

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