Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I would like to join the text "deceased: " and a date field [dateofdeath] in a textbox so the box would show, for example: deceased: 10/5/2001

    I've tried: ="deceased: " & [dateofdeath] in the control sourse of the textbox, but this returns #Error. For the life of me I just can't figure out why this won't work. Is it to do with the fact that dateofdeath is a date field?

    regards,

    Van

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    Just tocheck Van, is the control source of the form the table or query that holds the [dateofdeath] field.I ask as I have just tried this on a test database of mine and it works fine.

    ="Date of Death:" & [dateofdeath]
    Jerry

  3. #3
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='Jezza' post='774003' date='06-May-2009 23:38']Just tocheck Van, is the control source of the form the table or query that holds the [dateofdeath] field.I ask as I have just tried this on a test database of mine and it works fine.

    ="Date of Death:" & [dateofdeath][/quote]


    the control source is a table

  4. #4
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Jezza.

    Can you get yours to work if the control source is a table?

    I don't see why it works ok if the source is a query and not if it's a table.

    Thanks,

    Van

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    [quote name='vanleblanc' post='774001' date='07-May-2009 09:23']Hi,

    I would like to join the text "deceased: " and a date field [dateofdeath] in a textbox so the box would show, for example: deceased: 10/5/2001

    I've tried: ="deceased: " & [dateofdeath] in the control sourse of the textbox, but this returns #Error. For the life of me I just can't figure out why this won't work. Is it to do with the fact that dateofdeath is a date field?

    regards,

    Van[/quote]

    I suspect that you first added the field [dateofdeath] to the form/report, then tried to modify it to add "deceased". In this case the name of the control is 'dateofdeath' and Access gets confused because dateofdeath is both a fieldname and a control name.
    Change the name of the control to anything else- txtdeceased for example.

    Another thing to try would be to format the date as a string. "Deceased:" & format([dateofdeath],"mm/dd/yyyy') for example.
    Regards
    John



  6. #6
    2 Star Lounger
    Join Date
    Oct 2006
    Location
    Melbourne, Victoria, Australia
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that's it ! eureka!

    thanks muchly John

    Regards,
    Van

Posting Permissions

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