Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    format txt box that has date (97)

    Hi all -
    I found in my notes how to get a range of dates by typing them in 2 text boxes on a form. I put a button on the form and it filters the records to that date range and I can preview it or print it. What I want to do now is put the date range in the header of the report. I put a text box on the report with it's control source = forms!mydate!txtstart. If I put in 10/10/03 in the form box, 10/10/03 is what is returned on the report. I would like to have October 10, 2003 returned in the report. I tried a lot of combinations of mmmm dd yyyy in the format property of the text box on the report. I also tried putting the format command in the control source property without any luck. What am I doing wrong????? Thanks in advance. John

  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: format txt box that has date (97)

    I tried with this one of my reports.

    When I put mmmm dd yyyy in the format property of the textbox on the report, Access changed it to mmmm dd", "yyyy and it worked as required.

    The "', " is forcing the literal string to be put inside the date.

    I was using Access 2K but I don't think 97 is any different.
    Regards
    John



  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: format txt box that has date (97)

    Replace contents of textbox with =Format(Forms!mydate!txtstart,"mmmm dd, yyyy")
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  4. #4
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: format txt box that has date (97)

    Hi John
    That was 1 of the combinations I tried but it didn't format string. Maybe 97 is different. I will try it at work where I have 2000 to see if I can get it to work for me. Thanks for the reply. John

  5. #5
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: format txt box that has date (97)

    Hi Judy -
    I tried your suggestion but when I run the command it asks for the parameter value for Format(Forms!mydate!txtstart,"mmmm .
    Thanks for trying to help me. John

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: format txt box that has date (97)

    If the textbox is unbound then the value in it is a string, not a date, so you will need to convert it to a date using CDate before you can format it as a long date. You can do that in either the textbox itself by setting its datatype and format properties, or you can do it in the report by doing something like this:

    =Format(CDate(Forms!mydate!txtstart),"mmmm dd, yyyy")
    Charlotte

  7. #7
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: format txt box that has date (97)

    Hi Charlotte -
    It worked. Thank you so much.
    John

  8. #8
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: format txt box that has date (97)

    Hi Judy -
    I think I left the = sign out. Sorry. TY4URHelp. John

Posting Permissions

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