Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2002
    Location
    Arkansas
    Posts
    9

    Unanswered: Dates on a report, conditionally hide

    IN the header of a report I have t fields that pull data from two date fields on a form. One field is begdate, the other enddate and they are formatted for month & year only. I want to hide the end date if the begdate month and enddate month are the same. Please help!?

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Dates on a report, conditionally hide

    Try this code on the open of the report

    If begDate = endDate then
    enddate.visible = false
    else
    enddate.visible = true
    end if

    Originally posted by tessie
    IN the header of a report I have t fields that pull data from two date fields on a form. One field is begdate, the other enddate and they are formatted for month & year only. I want to hide the end date if the begdate month and enddate month are the same. Please help!?
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  3. #3
    Join Date
    Oct 2002
    Location
    Arkansas
    Posts
    9

    thanks

    Mona.. thanks so much. I had tried something similar but added code to look at datepart mm... I neglected to realize.. i didn't have to. At least I think so.. I"ll try it in the morning and let you know.

  4. #4
    Join Date
    Oct 2002
    Location
    Arkansas
    Posts
    9

    Re: Dates on a report, conditionally hide

    Originally posted by mona
    Try this code on the open of the report

    If begDate = endDate then
    enddate.visible = false
    else
    enddate.visible = true
    end if
    unfortunately that doesn't work, because the dates do not equal each other when you consider the day. So, I have to figure out a way to say IF the month part of begdate is = month part of end date...

  5. #5
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Dates on a report, conditionally hide

    try modifying the uf statement from before to ...
    If Month(begdate) = Month(EndDate) Then ....

    Hope this helps ....

    Originally posted by tessie
    unfortunately that doesn't work, because the dates do not equal each other when you consider the day. So, I have to figure out a way to say IF the month part of begdate is = month part of end date...
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  6. #6
    Join Date
    Oct 2002
    Location
    Arkansas
    Posts
    9

    Re: Dates on a report, conditionally hide

    Originally posted by mona
    try modifying the uf statement from before to ...
    If Month(begdate) = Month(EndDate) Then ....

    Hope this helps ....
    that did it, thank you!!!

  7. #7
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    just remember that will also say 1/1/01 and 1/1/02 are the same
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  8. #8
    Join Date
    Oct 2002
    Location
    Arkansas
    Posts
    9
    Yes, I've added code to account for the year. BUT, although this code worked on one report.. I just added it to another and get the msg that it cant' find the field month referred to in the expression' So, I'm working on figuring this one out!

  9. #9
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    dump the code up and i'll take a look, but make sure you've spelt the variable names right :-) always a pain that, the universes utimate Computer will do what you want not what you ask it :-)
    Last edited by m.timoney; 12-13-02 at 13:05.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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